Dynamic module import generates an error at parse time in contexts where it is not supported
Categories
(Core :: JavaScript Engine, task, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: jonco, Assigned: jonco)
Details
Attachments
(1 file)
Bug 1580536 - Make dynamic import a runtime error in contexts where we don't support it r?jorendorff
47 bytes,
text/x-phabricator-request
|
Details | Review |
Currently use of dynamic import causes a syntax error at parse time in web workers. Bug 1540913 comment 6 suggests that it would be more useful for this to fail at runtime as it would make it easier to provide a fallback for web worker scripts when run in FF.
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
This removes the parse-time check for whether dynamic import hook has been set. There's already a runtime check for this too, previously just to support enabling/disabling dynamic import via a pref. I updated web platform tests and expectations so that use of dynamic imports in wokers is now an expected failure (previously we would time out).
Comment 2•5 years ago
|
||
It would be very much appreciated to get the fix to replace the parse time with a run time check into FF.
I am creating a new web worker driven UI framework and this error is a big show stopper.
I had to replace several JS modules with copies (if possible), just to exclude unreachable code from FF.
In general: adding support for JS modules & dynamic imports inside the worker scope should get a high priority,
since this is a direction UI app development is moving towards to.
Thx & best regards
Tobi
Comment 6•5 years ago
|
||
bugherder |
Updated•5 years ago
|
Description
•