Closed
Bug 1484948
Opened 7 years ago
Closed 7 years ago
Parse dynamic module import syntax
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
mozilla64
People
(Reporter: jonco, Assigned: jonco)
References
Details
Attachments
(2 files)
30.82 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
2.98 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
Currently any use of an |import(specifier)| expression in scripts is a SyntaxError. In classic scripts, any use of |import| at all is an error and in module scripts it is an error because it's not a valid import statement.
As a step towards implementing dynamic import, this bug is to make the engine parse this syntax but throw an error when it is encountered. This won't change observable behaviour except:
- probably the type of error thrown will be different
- Reflect.parse will succeed for this syntax
Assignee | ||
Comment 1•7 years ago
|
||
Patch to parse dynamic import syntax.
This adds a CallImport parse node and makes the bytecode emitter throw when it encounters it. I added tests to check we can parse this.
I had to update the wpt test expectations because the dynamic import tests now fail in a slightly different way.
Attachment #9002770 -
Flags: review?(jorendorff)
Assignee | ||
Comment 2•7 years ago
|
||
Update to previous patch to make this throw a syntax error rather than an internal error until dynamic import is implemented.
Attachment #9006554 -
Flags: review?(jorendorff)
Comment 3•7 years ago
|
||
Comment on attachment 9002770 [details] [diff] [review]
bug1484948-parse-dynamic-import
Review of attachment 9002770 [details] [diff] [review]:
-----------------------------------------------------------------
I'm sorry for the slow review here. Looks good.
Attachment #9002770 -
Flags: review?(jorendorff) → review+
Comment 4•7 years ago
|
||
Comment on attachment 9006554 [details] [diff] [review]
bug1484948-parse-dynamic-import-2
Review of attachment 9006554 [details] [diff] [review]:
-----------------------------------------------------------------
That's better. Thanks.
Attachment #9006554 -
Flags: review?(jorendorff) → review+
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d1b2141b1c45
Parse dynamic module import syntax but throw SyntaxError if used r=jorendorff
Comment 6•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Comment 7•7 years ago
|
||
This was reverted for Fx64 in bug 1503009. It remains on Fx65+.
status-firefox65:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•