Closed
Bug 1155791
Opened 9 years ago
Closed 9 years ago
[Customizer] Fix global scope issues between scripts
Categories
(Firefox OS Graveyard :: Gaia, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: justindarc, Assigned: justindarc)
References
Details
Attachments
(1 file)
After confirming that Bug 1151586 is not actually an issue, I've concluded that the issues with global scope sharing between add-on scripts in the Customizer was being caused by certain components wrapped in closures that use `this` to infer the proper global scope, e.g.: ``` (function(window){ ... })(this); ``` In the outer-most scope of an injected add-on script, `window` !== `this` because `window` should point to the add-on sandbox. To eliminate confusion, the Customizer build should wrap all concatenated scripts in a closure to force the proper global scope, e.g.: ``` (function(){ }).call(window); ```
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → jdarcangelo
Blocks: spark-customizer
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8594142 -
Flags: review?(drs)
Comment 2•9 years ago
|
||
Comment on attachment 8594142 [details] [review] pull-request (master) Ah, nice catch. I left one comment on the PR.
Attachment #8594142 -
Flags: review?(drs) → review+
Assignee | ||
Comment 3•9 years ago
|
||
Landed on master: https://github.com/fxos/customizer/commit/8144972721798259cd76889d0da031404d47cf15
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•