-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1685482 - Part 2: Disallow identifiers named "async" in for-of lo…
…ops. r=yulia `for-of` loops mustn't start with the token sequence `async of`, because that leads to a shift-reduce conflict when parsing `for (async of => {};;)` or `for (async of [])`. This restriction doesn't apply to `for-await-of` loops, because `async` in `for await (async of ...)` is always parsed as an identifier. Parsing `for (async of ...)` already results in a SyntaxError, but that happens because `assignExpr()` always tries to parse the sequence `async [no LineTerminator] of` as the start of an async arrow function. That means `forHeadStart()` still needs to handle the case when `async` and `of` are separated by a line terminator. Part 3 will update the parser to allow `for await (async of ...)`. Spec change: tc39/ecma262#2256 Depends on D100994 Differential Revision: https://phabricator.services.mozilla.com/D100995 UltraBlame original commit: c260009506931dfe9e8c75906cd200e3ff687b79
- Loading branch information
Showing
4 changed files
with
1,219 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.