Skip to content

remove invalid JS according to newest spec#679

Draft
Archkon wants to merge 1 commit intomozilla-spidermonkey:masterfrom
Archkon:remov-invalid-js
Draft

remove invalid JS according to newest spec#679
Archkon wants to merge 1 commit intomozilla-spidermonkey:masterfrom
Archkon:remov-invalid-js

Conversation

@Archkon
Copy link

@Archkon Archkon commented Sep 27, 2025

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

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
Copy link
Collaborator

@arai-a arai-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this.

Unfortunately this change doesn't fit the adjacent context.


```js
for (async of => {};;) {}
for (async of []) {}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Archkon Archkon marked this pull request as draft September 29, 2025 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants