mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1091706 - Ensure spawning only one devtools loader instances. r=jryans
This commit is contained in:
parent
48c371fd07
commit
ce9a02c1da
@ -269,7 +269,9 @@ DevToolsLoader.prototype = {
|
||||
* @see setProvider
|
||||
*/
|
||||
require: function() {
|
||||
this._chooseProvider();
|
||||
if (!this._provider) {
|
||||
this._chooseProvider();
|
||||
}
|
||||
return this.require.apply(this, arguments);
|
||||
},
|
||||
|
||||
|
20
toolkit/devtools/tests/unit/test_require.js
Normal file
20
toolkit/devtools/tests/unit/test_require.js
Normal file
@ -0,0 +1,20 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Test devtools.require
|
||||
|
||||
// Ensure that DevtoolsLoader.require doesn't spawn multiple
|
||||
// loader/modules when early cached
|
||||
function testBug1091706() {
|
||||
let loader = new DevToolsLoader();
|
||||
let require = loader.require;
|
||||
|
||||
let color1 = require("devtools/css-color");
|
||||
let color2 = require("devtools/css-color");
|
||||
|
||||
do_check_true(color1 === color2);
|
||||
}
|
||||
|
||||
function run_test() {
|
||||
testBug1091706();
|
||||
}
|
@ -12,3 +12,4 @@ support-files =
|
||||
[test_async-utils.js]
|
||||
[test_consoleID.js]
|
||||
[test_require_lazy.js]
|
||||
[test_require.js]
|
||||
|
Loading…
Reference in New Issue
Block a user