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

ASI hazard with trailing +, -, /, and /= #19

Closed
rbuckton opened this issue Sep 27, 2023 · 1 comment · May be fixed by #18
Closed

ASI hazard with trailing +, -, /, and /= #19

rbuckton opened this issue Sep 27, 2023 · 1 comment · May be fixed by #18

Comments

@rbuckton
Copy link
Collaborator

The recent change in #17 to ban infix tokens runs afoul of an ASI hazard that results in different semantics between throw expressions and ThrowStatement for the +, -, /, and /= tokens:

a ?? throw b // <- ASI inserts semicolon
+ c // <- prefix '+'
// vs
throw b // <- no ASI
+ c
a ?? throw b // <- ASI inserts semicolon
- c // <- prefix '-'
// vs
throw b // <- no ASI
- c
a ?? throw b // <- ASI inserts semicolon
/ c/d // <- regexp literal
// vs
throw b // <- no ASI
/ c/d
a = throw b // <- ASI inserts semicolon
/=c/d // <- regexp literal
// vs
throw b // <- no ASI
/=c/d
@rbuckton
Copy link
Collaborator Author

The approach outlined here, and fixed by #17, did not achieve consensus. Closing in favor of #23 as an alternative solution.

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.

1 participant