Bug 1793573 - [devtools] Convert loader-plugin-raw.jsm to loader-plugin-raw.sys.mjs. r=Honza

Differential Revision: https://phabricator.services.mozilla.com/D158574
This commit is contained in:
Alexandre Poirot 2022-10-05 16:07:26 +00:00
Родитель 38067ca23e
Коммит 79f3e6c0de
3 изменённых файлов: 4 добавлений и 8 удалений

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

@ -11,8 +11,8 @@
var { Loader, Require, resolveURI, unload } = ChromeUtils.import(
"resource://devtools/shared/loader/base-loader.js"
);
var { requireRawId } = ChromeUtils.import(
"resource://devtools/shared/loader/loader-plugin-raw.jsm"
var { requireRawId } = ChromeUtils.importESModule(
"resource://devtools/shared/loader/loader-plugin-raw.sys.mjs"
);
const { AppConstants } = ChromeUtils.import(
"resource://gre/modules/AppConstants.jsm"

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

@ -2,8 +2,6 @@
* 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/. */
"use strict";
const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
/**
@ -12,7 +10,7 @@ const { NetUtil } = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
* This function handles "raw!" and "theme-loader!" requires.
* See also: https://github.com/webpack/raw-loader.
*/
const requireRawId = function(id, require) {
export const requireRawId = function(id, require) {
const index = id.indexOf("!");
const rawId = id.slice(index + 1);
let uri = require.resolve(rawId);
@ -39,5 +37,3 @@ const requireRawId = function(id, require) {
// result here.
return data;
};
const EXPORTED_SYMBOLS = ["requireRawId"];

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

@ -14,7 +14,7 @@ if CONFIG["MOZ_DEVTOOLS"] == "all":
DevToolsModules(
"base-loader.js",
"builtin-modules.js",
"loader-plugin-raw.jsm",
"loader-plugin-raw.sys.mjs",
"Loader.jsm",
"worker-loader.js",
)