remove invalid JS according to newest spec#679
Draft
Archkon wants to merge 1 commit intomozilla-spidermonkey:masterfrom
Draft
remove invalid JS according to newest spec#679Archkon wants to merge 1 commit intomozilla-spidermonkey:masterfrom
Archkon wants to merge 1 commit intomozilla-spidermonkey:masterfrom
Conversation
which will cause SyntaxError: The left-hand side of a for-of loop may not be 'async' refer to https://tc39.es/ecma262/#sec-for-in-and-for-of-statements
arai-a
requested changes
Sep 28, 2025
Collaborator
arai-a
left a comment
There was a problem hiding this comment.
Thank you for working on this.
Unfortunately this change doesn't fit the adjacent context.
|
|
||
| ```js | ||
| for (async of => {};;) {} | ||
| for (async of []) {} |
Collaborator
There was a problem hiding this comment.
The previous and the next paragraphs are talking about this code example, with "both", "first", and "second" words.
Also, this is used as an example of how LR(1) doesn't fit, where "async" and "of" become identifier or contextual-keyword depending on the following token. So, just removing the second line here doesn't work well.
So, for example these paragraphs should be replaced with some other examples that explains how LR(1) doesn't fit, or maybe just be removed if there's no other such.
Maybe something around for (using ... could be used.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This demo code would cause SyntaxError: The left-hand side of a for-of loop may not be 'async' among main js runtime
refer to https://tc39.es/ecma262/#sec-for-in-and-for-of-statements