Closed
Bug 1192391
Opened 9 years ago
Closed 9 years ago
Namespace pollution tests don't consider Cu.import() calls
Categories
(addons.mozilla.org Graveyard :: Add-on Validation, defect)
addons.mozilla.org Graveyard
Add-on Validation
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1191752
People
(Reporter: jwkbugzilla, Unassigned)
References
Details
Validator currently doesn't flag calls like the following:
Components.utils.import("resource://gre/modules/Services.jsm");
In a script loaded from an overlay this will create the global variable Services, without any namespacing. Correct call would be:
({my_addon_namespace.Services} = Components.utils.import("resource://gre/modules/Services.jsm", {}));
I'm not sure whether bug 1191752 is about the same thing, somebody forgot to explain the context there.
Updated•9 years ago
|
Flags: needinfo?(kmaglione+bmo)
Reporter | ||
Comment 1•9 years ago
|
||
Note that Components.utils.import("resource://gre/modules/Services.jsm", my_addon_namespace) would also be correct. It's only problematic (adding variables to global namespace) if the second parameter is missing.
Updated•9 years ago
|
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(kmaglione+bmo)
Resolution: --- → DUPLICATE
Assignee | ||
Updated•9 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•