Skip to content

Commit

Permalink
Bug 1830460 - Convert ComponentUtils.jsm to ESM. r=arai,webdriver-rev…
Browse files Browse the repository at this point in the history
…iewers,webcompat-reviewers,credential-management-reviewers,devtools-reviewers,twisniewski,sgalich,whimboo

Differential Revision: https://phabricator.services.mozilla.com/D176782
  • Loading branch information
mathewhodson committed May 3, 2023
1 parent fc609bf commit 5ee28fe
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const Cm = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
const classID = Components.ID("{97bf9550-2a7b-11e9-b56e-0800200c9a66}");

if (!Cm.isCIDRegistered(classID)) {
const { ComponentUtils } = ChromeUtils.import(
"resource://gre/modules/ComponentUtils.jsm"
const { ComponentUtils } = ChromeUtils.importESModule(
"resource://gre/modules/ComponentUtils.sys.mjs"
);

const factory = ComponentUtils.generateSingletonFactory(function() {
Expand Down
4 changes: 2 additions & 2 deletions devtools/server/actors/network-monitor/channel-event-sink.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

"use strict";

const { ComponentUtils } = ChromeUtils.import(
"resource://gre/modules/ComponentUtils.jsm"
const { ComponentUtils } = ChromeUtils.importESModule(
"resource://gre/modules/ComponentUtils.sys.mjs"
);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
* loader.
*/

var EXPORTED_SYMBOLS = ["ComponentUtils"];

const nsIFactoryQI = ChromeUtils.generateQI(["nsIFactory"]);

var ComponentUtils = {
export var ComponentUtils = {
/**
* Generates a singleton nsIFactory implementation that can be used as
* an argument to nsIComponentRegistrar.registerFactory.
Expand Down
2 changes: 1 addition & 1 deletion js/xpconnect/loader/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ EXPORTS.mozilla.loader += [
]

EXTRA_JS_MODULES += [
"ComponentUtils.jsm",
"ComponentUtils.sys.mjs",
"XPCOMUtils.sys.mjs",
]

Expand Down
4 changes: 1 addition & 3 deletions remote/cdp/observers/ChannelEventSink.sys.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
* 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/. */

const { ComponentUtils } = ChromeUtils.import(
"resource://gre/modules/ComponentUtils.jsm"
);
import { ComponentUtils } from "resource://gre/modules/ComponentUtils.sys.mjs";

const Cm = Components.manager;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@ const lazy = {};

ChromeUtils.defineESModuleGetters(lazy, {
AddressResult: "resource://autofill/ProfileAutoCompleteResult.sys.mjs",
ComponentUtils: "resource://gre/modules/ComponentUtils.sys.mjs",
CreditCardResult: "resource://autofill/ProfileAutoCompleteResult.sys.mjs",
FormAutofill: "resource://autofill/FormAutofill.sys.mjs",
FormAutofillUtils: "resource://gre/modules/shared/FormAutofillUtils.sys.mjs",
InsecurePasswordUtils: "resource://gre/modules/InsecurePasswordUtils.sys.mjs",
});

XPCOMUtils.defineLazyModuleGetters(lazy, {
ComponentUtils: "resource://gre/modules/ComponentUtils.jsm",
});

const autocompleteController = Cc[
"@mozilla.org/autocomplete/controller;1"
].getService(Ci.nsIAutoCompleteController);
Expand Down

0 comments on commit 5ee28fe

Please sign in to comment.