Closed
Bug 1477090
Opened 6 years ago
Closed 6 years ago
ES6 modules making synchronous XHRs prevents other modules from loading
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: johnplaisted, Assigned: jonco)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
(deleted),
application/zip
|
Details | |
(deleted),
patch
|
baku
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
Steps to reproduce:
Append script tags in JS for an ES6 module that imports another ES6 module that makes a synchronous XHR.
Actual results:
The second module (doing the importing) will never load.
Note: if you make a synchronous XHR in a script before any modules load and then do the above then the second module will SOMETIMES load and sometimes it won't.
Expected results:
The second module should always load.
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → jcoppeard
Blocks: harmony:modules
Assignee | ||
Comment 1•6 years ago
|
||
The problem here is that we are attempting to instantiate a module while a synchronous XHR is running. This re-enters the JS engine and the module graph is found to be in an invalid state.
The patch moves module instantiation to just before module execution where it is restricted by the script loader's existing checks on whether it is safe to run scripts.
I verified that this fixed the test case supplied.
Attachment #8996365 -
Flags: review?(amarchesini)
Updated•6 years ago
|
Attachment #8996365 -
Flags: review?(amarchesini) → review+
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/de7bc7bd4a16
Only instantiate modules when it's safe to run script r=baku
Comment 3•6 years ago
|
||
bugherder |
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•