зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1768022 - Use globalThis instead of Cu.getGlobalForObject(this). r=Standard8,webdriver-reviewers,necko-reviewers,whimboo,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D145842
This commit is contained in:
Родитель
601fdf4dc5
Коммит
32bc0bc61e
|
@ -49,8 +49,6 @@ var DEBUG = false; // non-const *only* so tweakable in server tests
|
|||
/** True if debugging output should be timestamped. */
|
||||
var DEBUG_TIMESTAMP = false; // non-const so tweakable in server tests
|
||||
|
||||
var gGlobalObject = Cu.getGlobalForObject(this);
|
||||
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { AppConstants } = ChromeUtils.import(
|
||||
"resource://gre/modules/AppConstants.jsm"
|
||||
|
@ -2879,7 +2877,7 @@ ServerHandler.prototype = {
|
|||
// If you update the list of imports, please update the list in
|
||||
// tools/lint/eslint/eslint-plugin-mozilla/lib/environments/sjs.js
|
||||
// as well.
|
||||
var s = Cu.Sandbox(gGlobalObject);
|
||||
var s = Cu.Sandbox(globalThis);
|
||||
s.importFunction(dump, "dump");
|
||||
s.importFunction(atob, "atob");
|
||||
s.importFunction(btoa, "btoa");
|
||||
|
|
|
@ -28,7 +28,7 @@ XPCOMUtils.defineLazyGetter(this, "ConsoleAPIStorage", () => {
|
|||
});
|
||||
|
||||
// Import the `Debugger` constructor in the current scope
|
||||
addDebuggerToGlobal(Cu.getGlobalForObject(this));
|
||||
addDebuggerToGlobal(globalThis);
|
||||
|
||||
const CONSOLE_API_LEVEL_MAP = {
|
||||
warn: "warning",
|
||||
|
|
|
@ -10,7 +10,7 @@ var EXPORTED_SYMBOLS = ["CoverageCollector"];
|
|||
const { addDebuggerToGlobal } = ChromeUtils.import(
|
||||
"resource://gre/modules/jsdebugger.jsm"
|
||||
);
|
||||
addDebuggerToGlobal(Cu.getGlobalForObject(this));
|
||||
addDebuggerToGlobal(globalThis);
|
||||
|
||||
/**
|
||||
* Records coverage for each test by way of the js debugger.
|
||||
|
|
Загрузка…
Ссылка в новой задаче