Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more tests for for (async of edge-cases #2983

Merged
merged 1 commit into from May 7, 2021

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented May 5, 2021

This adds tests for two more edge-cases related to the for (async of restriction (tc39/ecma262#2256):

for (\u0061sync of [7]);

In this case, the identifier async is written with an escape sequence. This avoids the async of lookahead, which only considers non-escaped words.

This detects implementations that check for an async token without considering whether it was escaped.

Recently fixed in V8: https://bugs.chromium.org/p/v8/issues/detail?id=11722

for ((async) of [7]);

In this case, the identifier token async is preceded by a ( token, which avoids the async of lookahead because async is no longer the first token in the head.

This detects implementations that check whether the LHS is an identifier at the AST level, without considering parentheses.

Motivated by babel/babel#13244 (review).

Copy link
Contributor

@jugglinmike jugglinmike left a comment

Choose a reason for hiding this comment

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

Very nice. Thanks for revisiting this!

@jugglinmike jugglinmike merged commit 9da1d61 into tc39:main May 7, 2021
@Zalathar Zalathar deleted the for-async-of branch May 7, 2021 23:22
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

test/language/statements/for-of/head-lhs-async-parens.js

@ghost

This comment has been minimized.

@jugglinmike
Copy link
Contributor

Hi there, @Zalathar. Test262 requires all contributors from non-Ecma member organizations sign a Contributors License Agreement. I forgot to ask you to do that--sorry! Would you mind signing it, now? It's totally okay if you can't; we'll just have to revert your patch.

@Zalathar
Copy link
Contributor Author

A CLA should be fine, but where can I find a privacy policy for the sensitive personal information required by the form?

@jugglinmike
Copy link
Contributor

@Zalathar I can't answer your questions myself, but I'm working to find someone who can (hence the delay). I'll keep you posted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants