Remove unused ChromeUtils.import calls
Categories
(Firefox :: General, enhancement, P3)
Tracking
()
People
(Reporter: kmag, Assigned: kmag)
References
Details
Attachments
(1 file)
Bug 1514594 requires that we rewrite existing ChromeUtils.import() callers to destructure a returned exports object, rather than rely on properties automatically being defined on the global scope. The rewrite script, in turn, needs to only destructure properties which are actually used by the script, in order to avoid triggering unused variable warnings in ESLint.
Actually running the script turns up a lot of imports where none of the exported symbols are actually used (and several where scripts attempt to destructure symbols from the module global which don't actually exist). It would be best if we can deal with these before we do the rewrite, partly to cut down on noise, and partly so we can add an ESLint rule to warn about ChromeUtils.import calls which ignore the return value, and therefore have no effect other than loading the module.
I'm going to do this in multiple parts. The first part will deal with the obvious cases, mainly JSMs and XPCOM components which run in their own scopes. Follow-ups will deal with most of the unit tests, and scripts which are loaded into shared scopes, where exports may be used in non-obvious ways.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
Updated•6 years ago
|
Assignee | ||
Comment 2•6 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/1e1580db8a5a9d5165da3bc28e7d09a11bff013a Bug 1519596: Part 1 - Remove several unnecessary/unused ChromeUtils.import() calls. r=Gijs
Comment 3•6 years ago
|
||
bugherder |
Pushed by archaeopteryx@coole-files.de: https://hg.mozilla.org/mozilla-central/rev/e3ba3ce79b84 Follow-up: Removes Services import because it's a redeclaration. a=merge https://hg.mozilla.org/mozilla-central/rev/060d26e4a442 Follow-up: Update PerTestCoverageUtils import in executormarionette.py. a=merge
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/15155 for changes under testing/web-platform/tests
Comment 6•5 years ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:kmag, maybe it's time to close this bug?
Comment 7•4 years ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:kmag, maybe it's time to close this bug?
Comment 8•4 years ago
|
||
The leave-open keyword is there and there is no activity for 6 months.
:bwinton, maybe it's time to close this bug?
Comment 9•4 years ago
|
||
KMag, is there a part 2 coming? Is it still relevant? Should we close this bug?
Assignee | ||
Comment 10•4 years ago
|
||
Eh, I don't even remember anymore, but I probably am not going to have time to do more on this any time soon.
Description
•