Syntax parsing of dynamic module import syntax succeeds when it shouldn't

RESOLVED FIXED in Firefox 65

Status

()

enhancement
RESOLVED FIXED
10 months ago
9 months ago

People

(Reporter: jonco, Assigned: jonco)

Tracking

61 Branch
mozilla64
Points:
---

Firefox Tracking Flags

(firefox64 disabled, firefox65 fixed)

Details

Attachments

(1 attachment)

Bug 1484948 added support for parsing dynamic module import syntax as a step to implementing this feature.  The idea was that a SyntaxError would be thrown if this was used and this was implemented by a check in the bytecode emitter.

However I forgot about syntax parsing, which currently accepts this syntax.  This means we can successfully create a lazy function that uses dynamic import.  This is wrong.
Patch to disallow syntax parsing if dynamic import.

I had to adjust the expected failure modes of a couple of WPT tests.

I'm pretty sure this is what is causing bug 1489782.
Attachment #9009892 - Flags: review?(jdemooij)
Comment on attachment 9009892 [details] [diff] [review]
bug1492074-dont-synax-parse-import

Review of attachment 9009892 [details] [diff] [review]:
-----------------------------------------------------------------

Maybe file a follow-up bug (blocking the right bug) to fix this once everything else is done?
Attachment #9009892 - Flags: review?(jdemooij) → review+
(In reply to Jan de Mooij [:jandem] from comment #2)
> Maybe file a follow-up bug (blocking the right bug) to fix this once
> everything else is done?

Or this will ~always be an error? Nevermind then :)
(In reply to Jan de Mooij [:jandem] from comment #3)
It won't be an error when dynamic import is fully implemented.  I'll make the fix to my patch stack now.
Pushed by jcoppeard@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/a73bc1d129c7
Syntax parse of dynamic module import syntax should fail since this is not yet implemented r=jandem
Pushed by apavel@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/805f1a2737a0
Syntax parse of dynamic module import syntax should fail since this is not yet implemented r=jandem on a CLOSED TREE
Flags: needinfo?(jcoppeard)
https://hg.mozilla.org/mozilla-central/rev/805f1a2737a0
Status: NEW → RESOLVED
Closed: 10 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Duplicate of this bug: 1489782
This was reverted for Fx64 in bug 1503009. It remains on Fx65+.
You need to log in before you can comment on or make changes to this bug.