зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1917530 - Fix ESLint no-shadow issues in devtools code. r=devtools-reviewers,profiler-reviewers,frontend-codestyle-reviewers,nchevobbe,julienw,mossop
Differential Revision: https://phabricator.services.mozilla.com/D221442
This commit is contained in:
Родитель
5f340a7a98
Коммит
7f08ffc091
|
@ -45,6 +45,7 @@ const xpcshellTestPaths = [
|
|||
// of the file.
|
||||
|
||||
const extraXpcshellTestPaths = [
|
||||
"devtools/client/shared/remote-debugging/adb/xpcshell/",
|
||||
"devtools/platform/tests/xpcshell/",
|
||||
"dom/file/tests/",
|
||||
"dom/ipc/tests/",
|
||||
|
|
|
@ -9,12 +9,18 @@ module.exports = {
|
|||
globals: {
|
||||
exports: true,
|
||||
isWorker: true,
|
||||
loader: true,
|
||||
module: true,
|
||||
require: true,
|
||||
DebuggerNotificationObserver: true,
|
||||
},
|
||||
overrides: [
|
||||
{
|
||||
files: ["**/*.*"],
|
||||
excludedFiles: ["**/*.sys.mjs", "**/*.worker.js"],
|
||||
globals: {
|
||||
loader: true,
|
||||
module: true,
|
||||
require: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ["client/framework/**"],
|
||||
rules: {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
// Parent config file for all devtools xpcshell files.
|
||||
module.exports = {
|
||||
extends: ["plugin:mozilla/xpcshell-test"],
|
||||
rules: {
|
||||
// Allow non-camelcase so that run_test doesn't produce a warning.
|
||||
camelcase: "off",
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
env: { browser: true },
|
||||
globals: {
|
||||
define: true,
|
||||
},
|
||||
|
|
|
@ -34,6 +34,7 @@ const { getCompactSymbolTable, queryAPI } = wasm_bindgen;
|
|||
// message properties.
|
||||
function createPlainErrorObject(e) {
|
||||
// Regular errors: just rewrap the object.
|
||||
// eslint-disable-next-line no-shadow
|
||||
const { name, message, fileName, lineNumber } = e;
|
||||
return { name, message, fileName, lineNumber };
|
||||
}
|
||||
|
@ -65,6 +66,7 @@ class FileAndPathHelper {
|
|||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-shadow
|
||||
const { name, path, debugPath, arch } = lib;
|
||||
const candidatePaths = [];
|
||||
|
||||
|
@ -152,6 +154,7 @@ class FileAndPathHelper {
|
|||
);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-shadow
|
||||
const { name, path, arch } = lib;
|
||||
const candidatePaths = [];
|
||||
|
||||
|
|
|
@ -419,6 +419,7 @@ export function getAllBrowsingContextsForContext(
|
|||
}
|
||||
|
||||
if (typeof module == "object") {
|
||||
// eslint-disable-next-line no-undef
|
||||
module.exports = {
|
||||
isBrowsingContextPartOfContext,
|
||||
isWindowGlobalPartOfContext,
|
||||
|
|
|
@ -46,6 +46,7 @@ const listeners = new Set();
|
|||
|
||||
// Detecting worker is different if this file is loaded via Common JS loader (isWorker global)
|
||||
// or as a JSM (constructor name)
|
||||
// eslint-disable-next-line no-shadow
|
||||
const isWorker =
|
||||
globalThis.isWorker ||
|
||||
globalThis.constructor.name == "WorkerDebuggerGlobalScope";
|
||||
|
@ -70,6 +71,8 @@ const customLazy = {
|
|||
// this module no longer has WorkerDebuggerGlobalScope as global,
|
||||
// but has to use require() to pull Debugger.
|
||||
if (isWorker) {
|
||||
// require is defined for workers.
|
||||
// eslint-disable-next-line no-undef
|
||||
return require("Debugger");
|
||||
}
|
||||
const { addDebuggerToGlobal } = ChromeUtils.importESModule(
|
||||
|
|
|
@ -129,6 +129,7 @@ export function workerify(fn) {
|
|||
"used in production."
|
||||
);
|
||||
// Fetch modules here as we don't want to include it normally.
|
||||
// eslint-disable-next-line no-shadow
|
||||
const { URL, Blob } = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
const stringifiedFn = createWorkerString(fn);
|
||||
const blob = new Blob([stringifiedFn]);
|
||||
|
|
|
@ -515,7 +515,7 @@ DevToolsStartup.prototype = {
|
|||
};
|
||||
}
|
||||
|
||||
const console = cmdLine.handleFlag("jsconsole", false);
|
||||
const jsConsole = cmdLine.handleFlag("jsconsole", false);
|
||||
const devtools = cmdLine.handleFlag("devtools", false);
|
||||
|
||||
let devToolsServer;
|
||||
|
@ -539,7 +539,12 @@ DevToolsStartup.prototype = {
|
|||
debuggerFlag = cmdLine.handleFlag("jsdebugger", false);
|
||||
}
|
||||
|
||||
return { console, debugger: debuggerFlag, devtools, devToolsServer };
|
||||
return {
|
||||
console: jsConsole,
|
||||
debugger: debuggerFlag,
|
||||
devtools,
|
||||
devToolsServer,
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче