Skip to content
Snippets Groups Projects
Commit badd55d1 authored by Tooru Fujisawa's avatar Tooru Fujisawa
Browse files

Bug 1667455 - Part 2: Add Services to system globals in ESLint. r=kmag

parent ad68a98f
No related branches found
No related tags found
No related merge requests found
...@@ -14,8 +14,10 @@ const EXPORTED_SYMBOLS = [ ...@@ -14,8 +14,10 @@ const EXPORTED_SYMBOLS = [
let Services; let Services;
if (typeof module == "object") { if (typeof module == "object") {
// Allow this JSM to also be loaded as a CommonJS module // Allow this JSM to also be loaded as a CommonJS module
// eslint-disable-next-line no-global-assign
Services = require("Services"); Services = require("Services");
} else { } else {
// eslint-disable-next-line no-global-assign
({ Services } = ChromeUtils.import("resource://gre/modules/Services.jsm")); ({ Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"));
} }
......
...@@ -37,6 +37,7 @@ if (typeof Components != "undefined") { ...@@ -37,6 +37,7 @@ if (typeof Components != "undefined") {
// loader. // loader.
// eslint-disable-next-line mozilla/reject-global-this // eslint-disable-next-line mozilla/reject-global-this
this.exports = {}; this.exports = {};
// eslint-disable-next-line no-global-assign
({ Services } = ChromeUtils.import("resource://gre/modules/Services.jsm")); ({ Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"));
// eslint-disable-next-line mozilla/reject-global-this // eslint-disable-next-line mozilla/reject-global-this
this.Services = Services; this.Services = Services;
......
...@@ -32,6 +32,7 @@ module.exports = { ...@@ -32,6 +32,7 @@ module.exports = {
InstallTrigger: false, InstallTrigger: false,
// https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/InternalError // https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/InternalError
InternalError: true, InternalError: true,
Services: false,
// https://developer.mozilla.org/docs/Web/API/Window/dump // https://developer.mozilla.org/docs/Web/API/Window/dump
dump: true, dump: true,
openDialog: false, openDialog: false,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment