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

Should throw on async () => await 5 ** 6; #187

Closed
fisker opened this issue Mar 29, 2021 · 6 comments · Fixed by #188
Closed

Should throw on async () => await 5 ** 6; #187

fisker opened this issue Mar 29, 2021 · 6 comments · Fixed by #188

Comments

@fisker
Copy link
Collaborator

fisker commented Mar 29, 2021

Babel PR babel/babel#12441

@3cp
Copy link
Member

3cp commented Apr 8, 2021

I am not very clear about the issue.
Does this come from an ambiguous spec on the precedence of "await" and "**"?

@3cp
Copy link
Member

3cp commented Apr 8, 2021

tc39/ecma262#2197
https://github.com/tc39/notes/blob/master/meetings/2020-11/nov-16.md#handling-await-in-left-operands-of-exponentiation

I am little surprised to see the discussion is all about the spec on left operands of exponentiation. Nobody talked about the precedence of operators??

@fisker

This comment has been minimized.

@3cp
Copy link
Member

3cp commented Apr 8, 2021

I could not find precedence discussed there.

@3cp
Copy link
Member

3cp commented Apr 8, 2021

Now I understand bit more, Estree defined ecma ExponentiationExpression inside BinaryExpression.
But ExponentiationExpression requires left operand to be UpdateExpression, while BinaryExpression does not do special check when operator is ** (highest precedence).

@3cp
Copy link
Member

3cp commented Apr 8, 2021

I need to check more. Our code seems rejecting other Non-UpdateExpreesion just fine +2**2, delete 2**2.

3cp added a commit that referenced this issue Apr 8, 2021
@3cp 3cp closed this as completed in #188 Jun 27, 2021
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 a pull request may close this issue.

2 participants