Closed Bug 1353690 Opened 7 years ago Closed 7 years ago

ASI not applied for "let <linebreak> await" in async functions

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: anba, Assigned: Waldo)

Details

Attachments

(1 file)

Test case:
---
async function f() {
    let
    await 0;
}
---

Expected: No SyntaxError
Actual: Reports a SyntaxError
Attached patch PatchSplinter Review
Saw this float by in bugmail, figured it'd be a simple patch, decided it was a good time to learn about how |await| keyword handling words.
Attachment #8855064 - Flags: review?(shu)
Assignee: nobody → jwalden+bmo
Status: NEW → ASSIGNED
Comment on attachment 8855064 [details] [diff] [review]
Patch

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

Looks good. Could you convert that test to a test262 test instead? What I've been doing is:

1. Add the test to test262/local
2. Open a PR upstream.
3. Remove the test262/local file when test262 is synced against a rev where the PR has been merged.
Attachment #8855064 - Flags: review?(shu) → review+
Pushed by jwalden@mit.edu:
https://hg.mozilla.org/integration/mozilla-inbound/rev/5001c15f9ec3
Properly exclude |await| from consideration as a |let| variable name in async functions, so that a newline between the two separates them into two distinct expressions.  r=shu
(In reply to Shu-yu Guo [:shu] from comment #2)
> 2. Open a PR upstream.

https://github.com/tc39/test262/pull/956
https://hg.mozilla.org/mozilla-central/rev/5001c15f9ec3
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: