mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1240494 - AMD support for DevTools loaders. r=jwalker,Honza
MozReview-Commit-ID: 7IemsaijHNc
This commit is contained in:
parent
714d7bcaa9
commit
ebf98a48dd
@ -110,11 +110,22 @@ function BrowserLoader(baseURI, window) {
|
||||
// Allow modules to use the window's console to ensure logs appear in a
|
||||
// tab toolbox, if one exists, instead of just the browser console.
|
||||
console: window.console,
|
||||
// Make sure 'define' function exists. This allows reusing AMD modules.
|
||||
define: function(callback) {
|
||||
callback(this.require, this.exports, this.module);
|
||||
return this.exports;
|
||||
}
|
||||
// Make sure `define` function exists. This allows defining some modules
|
||||
// in AMD format while retaining CommonJS compatibility through this hook.
|
||||
// JSON Viewer needs modules in AMD format, as it currently uses RequireJS
|
||||
// from a content document and can't access our usual loaders. So, any
|
||||
// modules shared with the JSON Viewer should include a define wrapper:
|
||||
//
|
||||
// // Make this available to both AMD and CJS environments
|
||||
// define(function(require, exports, module) {
|
||||
// ... code ...
|
||||
// });
|
||||
//
|
||||
// Bug 1248830 will work out a better plan here for our content module
|
||||
// loading needs, especially as we head towards devtools.html.
|
||||
define(factory) {
|
||||
factory(this.require, this.exports, this.module);
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -394,6 +394,22 @@ DevToolsLoader.prototype = {
|
||||
id: this.id,
|
||||
main: this.main
|
||||
},
|
||||
// Make sure `define` function exists. This allows defining some modules
|
||||
// in AMD format while retaining CommonJS compatibility through this hook.
|
||||
// JSON Viewer needs modules in AMD format, as it currently uses RequireJS
|
||||
// from a content document and can't access our usual loaders. So, any
|
||||
// modules shared with the JSON Viewer should include a define wrapper:
|
||||
//
|
||||
// // Make this available to both AMD and CJS environments
|
||||
// define(function(require, exports, module) {
|
||||
// ... code ...
|
||||
// });
|
||||
//
|
||||
// Bug 1248830 will work out a better plan here for our content module
|
||||
// loading needs, especially as we head towards devtools.html.
|
||||
define(factory) {
|
||||
factory(this.require, this.exports, this.module);
|
||||
},
|
||||
};
|
||||
// Lazy define console in order to load Console.jsm only when it is used
|
||||
XPCOMUtils.defineLazyGetter(this._provider.globals, "console", () => {
|
||||
|
Loading…
Reference in New Issue
Block a user