зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1431533: Part 5b - Fix ESLint errors left over after rewrite. r=florian
MozReview-Commit-ID: 7bVI1iM6hor --HG-- extra : source : 0b97a30cadb1a96d3cafae6b79ef0d3ec26770cf extra : amend_source : 09a90b29837e339eec7bdf8504f86c28e74ca3dd extra : intermediate-source : a1eca62826a1341ca24d4d2a93d4884d4fc7ad51 extra : histedit_source : eb26e73b531f9a34d3401d39f60b533b27b78540
This commit is contained in:
Родитель
918ed6c474
Коммит
19a956c2c6
|
@ -57,7 +57,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|||
|
||||
<implementation implements="nsIObserver, nsIDOMEventListener">
|
||||
<field name="ExtensionSearchHandler" readonly="true">
|
||||
(Components.utils.import("resource://gre/modules/ExtensionSearchHandler.jsm", {})).ExtensionSearchHandler;
|
||||
(ChromeUtils.import("resource://gre/modules/ExtensionSearchHandler.jsm", {})).ExtensionSearchHandler;
|
||||
</field>
|
||||
|
||||
<constructor><![CDATA[
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<implementation>
|
||||
|
||||
<field name="AppConstants" readonly="true">
|
||||
(Components.utils.import("resource://gre/modules/AppConstants.jsm", {})).AppConstants;
|
||||
(ChromeUtils.import("resource://gre/modules/AppConstants.jsm", {})).AppConstants;
|
||||
</field>
|
||||
|
||||
<field name="_indicatorBar">
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Promise.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Promise.jsm", this);
|
||||
|
||||
const kDefaultWait = 2000;
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@
|
|||
"anonid", "searchbar-textbox");</field>
|
||||
<field name="_engines">null</field>
|
||||
<field name="FormHistory" readonly="true">
|
||||
(Components.utils.import("resource://gre/modules/FormHistory.jsm", {})).FormHistory;
|
||||
(ChromeUtils.import("resource://gre/modules/FormHistory.jsm", {})).FormHistory;
|
||||
</field>
|
||||
|
||||
<property name="engines" readonly="true">
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {XPCOMUtils} = require("resource://gre/modules/XPCOMUtils.jsm");
|
||||
const ChromeUtils = require("ChromeUtils");
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "VariablesView",
|
||||
"resource://devtools/client/shared/widgets/VariablesView.jsm");
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
// here we call the identity provider directly
|
||||
function getIdentityAssertion(fpArray) {
|
||||
var Cu = SpecialPowers.Cu;
|
||||
var rtcid = ChromeUtils.import('resource://gre/modules/media/IdpSandbox.jsm');
|
||||
var rtcid = Cu.import('resource://gre/modules/media/IdpSandbox.jsm');
|
||||
var sandbox = new rtcid.IdpSandbox('example.com', 'idp.js', window);
|
||||
return sandbox.start()
|
||||
.then(idp => SpecialPowers.wrap(idp)
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<script class="testbody" type="application/javascript">
|
||||
"use strict";
|
||||
var Cu = SpecialPowers.Cu;
|
||||
var rtcid = ChromeUtils.import("resource://gre/modules/media/IdpSandbox.jsm");
|
||||
var rtcid = Cu.import("resource://gre/modules/media/IdpSandbox.jsm");
|
||||
var IdpSandbox = rtcid.IdpSandbox;
|
||||
var dummyPayload = JSON.stringify({
|
||||
this: 'is',
|
||||
|
|
|
@ -26,7 +26,7 @@ const Cu = SpecialPowers.Cu;
|
|||
function doTest() {
|
||||
msg = "Services should be imported on window";
|
||||
try {
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm", window);
|
||||
Cu.import("resource://gre/modules/Services.jsm", window);
|
||||
ok(Services, msg);
|
||||
} catch (ex) {
|
||||
ok(false, msg + " : " + ex);
|
||||
|
@ -35,7 +35,7 @@ function doTest() {
|
|||
msg = "Services should be imported on myObj";
|
||||
try {
|
||||
var myObj = {};
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm", myObj);
|
||||
Cu.import("resource://gre/modules/Services.jsm", myObj);
|
||||
ok(myObj.Services, msg);
|
||||
} catch (ex) {
|
||||
ok(false, msg + " : " + ex);
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
* for more information.
|
||||
*/
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
var _quit = false;
|
||||
var _tests_pending = 0;
|
||||
var _pendingTimers = [];
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
"use strict";
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/Messaging.jsm");
|
||||
|
|
|
@ -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/. */
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
Components.utils.import("resource://gre/modules/Messaging.jsm");
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Messaging.jsm");
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
Components.utils.import("resource://gre/modules/Messaging.jsm");
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
var Cu = Components.utils;
|
||||
|
||||
Cu.import("resource://gre/modules/Messaging.jsm");
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
|
|
@ -4,6 +4,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/. */
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
Components.utils.import("resource://gre/modules/ReaderMode.jsm");
|
||||
|
||||
var java = new JavaBridge(this);
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
/* globals ReaderMode */
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
var { utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/ReaderMode.jsm");
|
||||
|
|
|
@ -3,6 +3,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/. */
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
|
|
@ -3,6 +3,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/. */
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
|
|
@ -3,6 +3,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/. */
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
var Cc = Components.classes;
|
||||
var Ci = Components.interfaces;
|
||||
var Cu = Components.utils;
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/ClientID.jsm");
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
|
||||
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
|
||||
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
const {classes: Cc, interfaces: Ci} = Components;
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
const {classes: Cc, interfaces: Ci} = Components;
|
||||
|
||||
ChromeUtils.import("chrome://marionette/content/assert.js");
|
||||
const {element} = ChromeUtils.import("chrome://marionette/content/element.js", {});
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/AddonManager.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Preferences.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
const {classes: Cc, interfaces: Ci} = Components;
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Preferences.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {interfaces: Ci, utils: Cu, results: Cr} = Components;
|
||||
const {interfaces: Ci, results: Cr} = Components;
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ this.event = {};
|
|||
"use strict";
|
||||
/* global content, is */
|
||||
|
||||
const {interfaces: Ci, utils: Cu, classes: Cc} = Components;
|
||||
const {interfaces: Ci, classes: Cc} = Components;
|
||||
|
||||
ChromeUtils.import("chrome://marionette/content/element.js");
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Log.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["pprint", "truncate"];
|
||||
|
|
|
@ -15,8 +15,6 @@
|
|||
* content retrieved.
|
||||
*/
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
ChromeUtils.import("chrome://marionette/content/assert.js");
|
||||
ChromeUtils.import("chrome://marionette/content/error.js");
|
||||
const {truncate} = ChromeUtils.import("chrome://marionette/content/format.js", {});
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
* Called to clean up at the end of use
|
||||
*/
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
const {classes: Cc, interfaces: Ci} = Components;
|
||||
const {StreamUtils} =
|
||||
ChromeUtils.import("chrome://marionette/content/stream-utils.js", {});
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {utils: Cu} = Components;
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Log.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {interfaces: Ci, utils: Cu} = Components;
|
||||
const {interfaces: Ci} = Components;
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Log.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Preferences.jsm");
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {Constructor: CC, interfaces: Ci, utils: Cu} = Components;
|
||||
const {Constructor: CC, interfaces: Ci} = Components;
|
||||
|
||||
const ServerSocket = CC(
|
||||
"@mozilla.org/network/server-socket;1",
|
||||
|
|
|
@ -8,7 +8,6 @@ const {
|
|||
Constructor: CC,
|
||||
classes: Cc,
|
||||
interfaces: Ci,
|
||||
utils: Cu,
|
||||
results: Cr,
|
||||
} = Components;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
|
||||
const {classes: Cc, interfaces: Ci} = Components;
|
||||
|
||||
const {
|
||||
error,
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
/* global Pipe, ScriptableInputStream, uneval */
|
||||
|
||||
const {Constructor: CC, classes: Cc, utils: Cu, results: Cr} = Components;
|
||||
const {Constructor: CC, classes: Cc, results: Cr} = Components;
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/EventEmitter.jsm");
|
||||
|
|
|
@ -43,6 +43,7 @@ var Profiler;
|
|||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
} catch (e) {}
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
try {
|
||||
_profiler = Components.classes["@mozilla.org/tools/profiler;1"].getService(Components.interfaces.nsIProfiler);
|
||||
} catch (ex) { (typeof(dumpLog) == "undefined" ? dump : dumpLog)(ex + "\n"); }
|
||||
|
@ -112,8 +113,8 @@ var Profiler;
|
|||
Services.profiler.getProfileDataAsync().then((profile) => {
|
||||
let profileFile = profiler_dir + "/" + currentTest + ".profile";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/FileUtils.jsm");
|
||||
Components.utils.import("resource://gre/modules/NetUtil.jsm");
|
||||
Components.utils.import("resource://gre/modules/FileUtils.jsm");
|
||||
|
||||
var file = Components.classes["@mozilla.org/file/local;1"].
|
||||
createInstance(Components.interfaces.nsIFile);
|
||||
|
|
|
@ -6,7 +6,8 @@ if (typeof(TalosContentProfiler) == "undefined") {
|
|||
try {
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
} catch (e) {}
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Services.scriptloader.loadSubScript("chrome://talos-powers-content/content/TalosContentProfiler.js");
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,8 @@ var TalosContentProfiler;
|
|||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
} catch (e) {}
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
/**
|
||||
* Emits a TalosContentProfiler prefixed event and then returns a Promise
|
||||
|
|
|
@ -21,9 +21,6 @@ XPCOMUtils.defineLazyGetter(this, "TargetFactory", function() {
|
|||
let { TargetFactory } = require("devtools/client/framework/target");
|
||||
return TargetFactory;
|
||||
});
|
||||
XPCOMUtils.defineLazyGetter(this, "ChromeUtils", function() {
|
||||
return require("ChromeUtils");
|
||||
});
|
||||
|
||||
const webserver = Services.prefs.getCharPref("addon.test.damp.webserver");
|
||||
|
||||
|
|
|
@ -113,7 +113,8 @@ addEventListener("load", function() {
|
|||
} catch (e) {}
|
||||
|
||||
try {
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Services.scriptloader.loadSubScript("chrome://talos-powers-content/content/TalosContentProfiler.js");
|
||||
|
||||
TalosContentProfiler.resume("rasterflood_gradient.html loaded", true).then(() => {
|
||||
|
|
|
@ -140,7 +140,8 @@ addEventListener("load", function() {
|
|||
} catch (e) {}
|
||||
|
||||
try {
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Services.scriptloader.loadSubScript("chrome://talos-powers-content/content/TalosContentProfiler.js");
|
||||
|
||||
TalosContentProfiler.resume("rasterflood_svg.html loaded", true).then(() => {
|
||||
|
|
|
@ -55,7 +55,8 @@ addEventListener("load", function() {
|
|||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
} catch (e) {}
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
Components.utils.import("resource://gre/modules/Services.jsm");
|
||||
Services.scriptloader.loadSubScript("chrome://talos-powers-content/content/TalosContentProfiler.js");
|
||||
|
||||
TalosContentProfiler.resume("displaylist_mutate.html loaded", true).then(() => {
|
||||
|
|
|
@ -66,6 +66,7 @@ function goQuitApplication(waitForSafeBrowsing) {
|
|||
const privs = "UniversalPreferencesRead UniversalPreferencesWrite " +
|
||||
"UniversalXPConnect";
|
||||
|
||||
/* eslint-disable mozilla/use-chromeutils-import */
|
||||
try {
|
||||
netscape.security.PrivilegeManager.enablePrivilege(privs);
|
||||
} catch (ex) {
|
||||
|
|
|
@ -5,11 +5,12 @@
|
|||
"use strict";
|
||||
|
||||
/* import-globals-from ../../devtools/server/main.js */
|
||||
/* eslint "mozilla/use-chromeutils-import": ["error", {allowCu: true}] */
|
||||
|
||||
const Cu = Components.utils;
|
||||
const { Promise } = ChromeUtils.import("resource://gre/modules/Promise.jsm", {});
|
||||
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm", {});
|
||||
const { devtools } = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const { Promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
|
||||
var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
|
||||
const { devtools } = Cu.import("resource://devtools/shared/Loader.jsm", {});
|
||||
const { RootActor } = devtools.require("devtools/server/actors/root");
|
||||
const { BrowserTabList } = devtools.require("devtools/server/actors/webbrowser");
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
|
||||
/* exported checkSitePermissions */
|
||||
|
||||
const {Services, Cu} = SpecialPowers;
|
||||
const {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm", {});
|
||||
const {Services} = SpecialPowers;
|
||||
const {NetUtil} = SpecialPowers.Cu.import("resource://gre/modules/NetUtil.jsm", {});
|
||||
|
||||
function checkSitePermissions(uuid, expectedPermAction, assertMessage) {
|
||||
if (!uuid) {
|
||||
|
|
|
@ -19,7 +19,8 @@ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
|||
XPCOMUtils.defineLazyGetter(this, "profileStorage", () => {
|
||||
let profileStorage;
|
||||
try {
|
||||
profileStorage = ChromeUtils.import("resource://formautofill/ProfileStorage.jsm", {}).profileStorage;
|
||||
profileStorage = ChromeUtils.import(
|
||||
"resource://formautofill/ProfileStorage.jsm", {}).profileStorage;
|
||||
profileStorage.initialize();
|
||||
} catch (ex) {
|
||||
profileStorage = null;
|
||||
|
|
|
@ -16,8 +16,10 @@ const paymentSrv = Cc["@mozilla.org/dom/payments/payment-request-service;1"]
|
|||
.getService(Ci.nsIPaymentRequestService);
|
||||
const paymentUISrv = Cc["@mozilla.org/dom/payments/payment-ui-service;1"]
|
||||
.getService().wrappedJSObject;
|
||||
const {profileStorage} = ChromeUtils.import("resource://formautofill/ProfileStorage.jsm", {});
|
||||
const {PaymentTestUtils: PTU} = ChromeUtils.import("resource://testing-common/PaymentTestUtils.jsm", {});
|
||||
const {profileStorage} = ChromeUtils.import(
|
||||
"resource://formautofill/ProfileStorage.jsm", {});
|
||||
const {PaymentTestUtils: PTU} = ChromeUtils.import(
|
||||
"resource://testing-common/PaymentTestUtils.jsm", {});
|
||||
|
||||
function getPaymentRequests() {
|
||||
let requestsEnum = paymentSrv.enumerate();
|
||||
|
|
|
@ -331,7 +331,7 @@
|
|||
let defaultButton = this.ui["button" + bnum];
|
||||
|
||||
let { AppConstants } =
|
||||
Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
|
||||
ChromeUtils.import("resource://gre/modules/AppConstants.jsm", {});
|
||||
if (AppConstants.platform == "macosx") {
|
||||
// On OS X, the default button always stays marked as such (until
|
||||
// the entire prompt blurs).
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
* Interface to a dedicated thread handling readability parsing.
|
||||
*/
|
||||
|
||||
const Cu = Components.utils;
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/PromiseWorker.jsm", this);
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["ReaderWorker"];
|
||||
|
|
|
@ -460,8 +460,8 @@ FormAutoComplete.prototype = {
|
|||
// that we use the one defined here. To get around that, we explicitly
|
||||
// import the module here, out of the way of the other uses of
|
||||
// FormAutoCompleteResult.
|
||||
let {FormAutoCompleteResult} = ChromeUtils.import("resource://gre/modules/nsFormAutoCompleteResult.jsm",
|
||||
{});
|
||||
let {FormAutoCompleteResult} = ChromeUtils.import(
|
||||
"resource://gre/modules/nsFormAutoCompleteResult.jsm", {});
|
||||
return new FormAutoCompleteResult(datalistResult.searchString,
|
||||
Ci.nsIAutoCompleteResult.RESULT_SUCCESS,
|
||||
0,
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
this._draggableStarted = true;
|
||||
try {
|
||||
let tmp = {};
|
||||
Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
|
||||
ChromeUtils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
|
||||
let draghandle = new tmp.WindowDraggingElement(this);
|
||||
draghandle.mouseDownCheck = function() {
|
||||
return this._dragBindingAlive;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
|
||||
|
||||
this.EXPORTED_SYMBOLS = ["AppConstants"];
|
||||
|
||||
|
|
|
@ -54,8 +54,10 @@ var Components_ = this.require ? require("chrome").components : Components;
|
|||
|
||||
// If Cu is defined, use it to lazily define the FinalizationWitnessService.
|
||||
if (Cu) {
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
// If we're in a devtools module environment, ChromeUtils won't exist.
|
||||
/* eslint "mozilla/use-chromeutils-import": ["error", {allowCu: true}] */
|
||||
Cu.import("resource://gre/modules/Services.jsm");
|
||||
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(this, "FinalizationWitnessService",
|
||||
"@mozilla.org/toolkit/finalizationwitness;1",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Promise.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Promise.jsm", this);
|
||||
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
|
||||
var GMPScope = ChromeUtils.import("resource://gre/modules/addons/GMPProvider.jsm", {});
|
||||
|
||||
|
|
|
@ -28,8 +28,5 @@ ruleTester.run("no-single-arg-cu-import", rule, {
|
|||
invalid: [{
|
||||
code: "Cu.import('fake');",
|
||||
errors: [ExpectedError]
|
||||
}, {
|
||||
code: "ChromeUtils.import('fake');",
|
||||
errors: [ExpectedError]
|
||||
}]
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче