Closed
Bug 1758474
Opened 3 years ago
Closed 3 years ago
Implement an ESLint rule to disallow passing {} as the target parameter for `ChromeUtils.import`
Categories
(Developer Infrastructure :: Lint and Formatting, task, P3)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox100 fixed)
RESOLVED
FIXED
100 Branch
Tracking | Status | |
---|---|---|
firefox100 | --- | fixed |
People
(Reporter: standard8, Assigned: standard8)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
We have lots of cases in the code where we're doing something like:
let { PermissionUI } = ChromeUtils.import(
"resource:///modules/PermissionUI.jsm",
{}
);
However, the {}
parameter is now redundant - it used to stop import into the global environment, but how that works has now changed.
I have a patch to do this, it also tidies up some instances to use object destructuring.
Assignee | ||
Comment 1•3 years ago
|
||
Depends on D140516
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5018856d8fee
Implement an ESLint rule to disallow passing {} as the target parameter for ChromeUtils.import. r=Gijs,mossop,perftest-reviewers,preferences-reviewers,sparky
Comment 3•3 years ago
|
||
Backed out changeset 5018856d8fee (bug 1758474) for causing node eslint failure.
Backout link: https://hg.mozilla.org/integration/autoland/rev/9a3cf71fe2f7be7919f564182a0829f2bf083d6e
[task 2022-03-10T09:41:23.814Z] TEST-UNEXPECTED-FAIL | reject-chromeutils-import-params.js | ChromeUtils.import("resource://some/path/to/My.js", {}) | args.at is not a function
[task 2022-03-10T09:41:23.814Z] Occurred while linting <input>:1
Flags: needinfo?(standard8)
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bbd63e7b1857
Implement an ESLint rule to disallow passing {} as the target parameter for ChromeUtils.import. r=Gijs,mossop,perftest-reviewers,preferences-reviewers,sparky
Assignee | ||
Updated•3 years ago
|
Flags: needinfo?(standard8)
Comment 5•3 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 3 years ago
status-firefox100:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 100 Branch
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/9b6afe631195
fix up 2 remaining callers passing {} as the target parameter for `ChromeUtils.import`. rs=eslint
Updated•2 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
•