Bug 1798294 - Convert fathom.jsm to an ES module. r=sgalich

Depends on D160800

Differential Revision: https://phabricator.services.mozilla.com/D160801
This commit is contained in:
Mark Banner 2022-10-31 15:08:07 +00:00
Родитель 0b27ce2b67
Коммит 159705bf2a
7 изменённых файлов: 2788 добавлений и 2809 удалений

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

@ -26,10 +26,16 @@ const EXPORTED_SYMBOLS = ["creditCardRulesets"];
const { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
const { fathom } = ChromeUtils.import(
"resource://gre/modules/third_party/fathom/fathom.jsm"
const {
element: clickedElement,
out,
rule,
ruleset,
score,
type,
} = ChromeUtils.importESModule(
"resource://gre/modules/third_party/fathom/fathom.mjs"
);
const { element: clickedElement, out, rule, ruleset, score, type } = fathom;
const { CreditCard } = ChromeUtils.importESModule(
"resource://gre/modules/CreditCard.sys.mjs"
);

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

@ -9,10 +9,6 @@
const EXPORTED_SYMBOLS = ["NewPasswordModel"];
const { fathom } = ChromeUtils.import(
"resource://gre/modules/third_party/fathom/fathom.jsm"
);
const {
dom,
element,
@ -23,7 +19,9 @@ const {
type,
utils: { identity, isVisible, min, setDefault },
clusters: { euclidean },
} = fathom;
} = ChromeUtils.importESModule(
"resource://gre/modules/third_party/fathom/fathom.mjs"
);
/**
* ----- Start of model -----

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

@ -233,7 +233,7 @@ EXTRA_JS_MODULES.sessionstore += [
"sessionstore/Utils.jsm",
]
EXTRA_JS_MODULES.third_party.fathom += ["third_party/fathom/fathom.jsm"]
EXTRA_JS_MODULES.third_party.fathom += ["third_party/fathom/fathom.mjs"]
if CONFIG["MOZ_WIDGET_TOOLKIT"] in ("windows", "gtk"):
DEFINES["MENUBAR_CAN_AUTOHIDE"] = 1

11
toolkit/modules/third_party/fathom/README поставляемый
Просмотреть файл

@ -4,7 +4,14 @@ upstream and integrated back here.
In order to regenerate this file, do the following:
* Run:
$ git clone git@github.com:mozilla/fathom.git && cd fathom/fathom
$ make bundle
$ export MOZ_FATHOM="../mozilla-central/toolkit/modules/third_party/fathom"
* Ensure that [this pull request](https://github.com/mozilla/fathom/pull/311)
is either landed or been applied to the latest code you want to bundle.
* Then run:
$ make bundleESModule
$ export MOZ_FATHOM="../../mozilla-central/toolkit/modules/third_party/fathom"
$ cat $MOZ_FATHOM/fx-header dist/fathom.js > $MOZ_FATHOM/fathom.jsm

2794
toolkit/modules/third_party/fathom/fathom.jsm поставляемый

Разница между файлами не показана из-за своего большого размера Загрузить разницу

2765
toolkit/modules/third_party/fathom/fathom.mjs поставляемый Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -1,11 +1,8 @@
/*
DO NOT TOUCH fathom.jsm DIRECTLY. See the README for instructions.
DO NOT TOUCH fathom.mjs DIRECTLY. See the README for instructions.
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* 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";
this.EXPORTED_SYMBOLS = ["fathom"];