Bug 1813377 - Clean up XPCNativeWrapper globals handling for ESLint. r=mccr8

XPCNativeWrapper may be going away (bug 1481337). Stop defining it in the main environments and only define it
where necessary to discourage more uses.
This also helps to clarify the ESLint test environment globals.

Differential Revision: https://phabricator.services.mozilla.com/D168211
This commit is contained in:
Mark Banner 2023-01-30 21:55:25 +00:00
Родитель e1d65f08eb
Коммит 106725dcfc
9 изменённых файлов: 16 добавлений и 4 удалений

Просмотреть файл

@ -20,7 +20,6 @@ module.exports = {
loader: true,
Services: true,
Task: true,
XPCNativeWrapper: true,
XPCOMUtils: true,
_Iterator: true,
__dirname: true,

Просмотреть файл

@ -3,6 +3,10 @@
// Ensure that same-origin errors are logged to the console.
// XPCNativeWrapper is not defined globally in ESLint as it may be going away.
// See bug 1481337.
/* global XPCNativeWrapper */
"use strict";
const TEST_URI =

Просмотреть файл

@ -3,6 +3,10 @@
// Ensure that same-origin errors are logged to the console.
// XPCNativeWrapper is not defined globally in ESLint as it may be going away.
// See bug 1481337.
/* global XPCNativeWrapper */
"use strict";
const TEST_URI =

Просмотреть файл

@ -2,6 +2,8 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// XPCNativeWrapper is not defined globally in ESLint as it may be going away.
// See bug 1481337.
/* global XPCNativeWrapper */
"use strict";

Просмотреть файл

@ -18,6 +18,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=533596
<!-- test code goes here -->
<script type="application/javascript"><![CDATA[
// XPCNativeWrapper is not defined globally in ESLint as it may be going away.
// See bug 1481337.
/* global XPCNativeWrapper */
/** Test for Bug 533596 **/
function go() {

Просмотреть файл

@ -12,6 +12,8 @@
* chrome-privileged scripts when they need to interact with privileged APIs.
*/
// XPCNativeWrapper is not defined globally in ESLint as it may be going away.
// See bug 1481337.
/* globals XPCNativeWrapper */
Cu.crashIfNotInAutomation();

Просмотреть файл

@ -23,7 +23,6 @@ module.exports = {
PromiseDebugging: false,
SpecialPowers: false,
TestUtils: false,
XPCNativeWrapper: false,
addLoadEvent: false,
add_setup: false,
add_task: false,

Просмотреть файл

@ -11,7 +11,6 @@ module.exports = {
globals: {
// SpecialPowers is injected into the window object via SimpleTest.js
SpecialPowers: false,
XPCNativeWrapper: false,
extractJarToTmp: false,
getChromeDir: false,
getJar: false,

Просмотреть файл

@ -10,7 +10,6 @@ module.exports = {
globals: {
// SpecialPowers is injected into the window object via SimpleTest.js
SpecialPowers: false,
XPCNativeWrapper: false,
},
overrides: [