зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1740292 - [devtools] Use a single method to create xpcshell target globals. r=nchevobbe
testGlobal and createTestGlobal were redundant. Differential Revision: https://phabricator.services.mozilla.com/D130840
This commit is contained in:
Родитель
d3c1ad40a8
Коммит
572abaa684
|
@ -346,16 +346,8 @@ var listener = {
|
|||
|
||||
Services.console.registerListener(listener);
|
||||
|
||||
function testGlobal(name) {
|
||||
const sandbox = Cu.Sandbox(
|
||||
Cc["@mozilla.org/systemprincipal;1"].createInstance(Ci.nsIPrincipal)
|
||||
);
|
||||
sandbox.__name = name;
|
||||
return sandbox;
|
||||
}
|
||||
|
||||
function addTestGlobal(name, server = DevToolsServer) {
|
||||
const global = testGlobal(name);
|
||||
const global = createTestGlobal(name);
|
||||
server.addTestGlobal(global);
|
||||
return global;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ function run_test() {
|
|||
const xpcInspector = Cc["@mozilla.org/jsinspector;1"].getService(
|
||||
Ci.nsIJSInspector
|
||||
);
|
||||
const g = testGlobal("test1");
|
||||
const g = createTestGlobal("test1");
|
||||
|
||||
const dbg = makeDebugger();
|
||||
dbg.uncaughtExceptionHook = testExceptionHook;
|
||||
|
|
|
@ -8,7 +8,7 @@ function run_test() {
|
|||
"resource://gre/modules/jsdebugger.jsm"
|
||||
);
|
||||
addDebuggerToGlobal(this);
|
||||
const g = testGlobal("test1");
|
||||
const g = createTestGlobal("test1");
|
||||
|
||||
const dbg = makeDebugger();
|
||||
dbg.addDebuggee(g);
|
||||
|
@ -24,7 +24,7 @@ function run_test() {
|
|||
|
||||
g.eval("function stopMe(arg) {debugger;}");
|
||||
|
||||
const g2 = testGlobal("test2");
|
||||
const g2 = createTestGlobal("test2");
|
||||
g2.g = g;
|
||||
// Not using the "stringify a function" trick because that runs afoul of the
|
||||
// Cu.importGlobalProperties lint and we don't need it here anyway.
|
||||
|
|
|
@ -36,7 +36,9 @@
|
|||
const Debugger = require("Debugger");
|
||||
|
||||
function test_promises_run_to_completion() {
|
||||
const g = testGlobal("test global for test_promises_run_to_completion.js");
|
||||
const g = createTestGlobal(
|
||||
"test global for test_promises_run_to_completion.js"
|
||||
);
|
||||
const dbg = new Debugger(g);
|
||||
g.Assert = Assert;
|
||||
const log = [""];
|
||||
|
|
|
@ -8,7 +8,7 @@ function run_test() {
|
|||
"resource://gre/modules/jsdebugger.jsm"
|
||||
);
|
||||
addDebuggerToGlobal(this);
|
||||
const g = testGlobal("test");
|
||||
const g = createTestGlobal("test");
|
||||
const dbg = new Debugger();
|
||||
const gw = dbg.addDebuggee(g);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче