Closed
Bug 1776837
Opened 3 years ago
Closed 3 years ago
Reject lazy getters that are already imported eagerly
Categories
(Developer Infrastructure :: Lint and Formatting, enhancement)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox104 fixed)
RESOLVED
FIXED
104 Branch
Tracking | Status | |
---|---|---|
firefox104 | --- | fixed |
People
(Reporter: mossop, Assigned: arai)
References
Details
Attachments
(2 files)
It can happen that a single jsm has multiple exports. If you're importing one of them eagerly then there is no point in doing lazy imports for the others. e.g. this pattern should be rejected:
const { UrlbarProvider } = ChromeUtils.import(
"resource:///modules/UrlbarUtils.jsm"
);
const lazy = {};
XPCOMUtils.defineLazyModuleGetters(lazy, {
UrlbarUtils: "resource:///modules/UrlbarUtils.jsm",
});
Assignee | ||
Comment 1•3 years ago
|
||
Updated•3 years ago
|
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•3 years ago
|
||
Depends on D150935
Pushed by arai_a@mac.com:
https://hg.mozilla.org/integration/autoland/rev/176964039b97
Part 1: Do not use lazy getter for eagerly loaded modules. r=mossop,webdriver-reviewers,application-update-reviewers,jdescottes
https://hg.mozilla.org/integration/autoland/rev/35fcac797332
Part 2: Reject defining lazy getter for module that is already loaded eagerly at top-level. r=mossop
Comment 4•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/176964039b97
https://hg.mozilla.org/mozilla-central/rev/35fcac797332
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
status-firefox104:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
Updated•3 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•