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

[babel 8] Require throw expression to be wrapped in parentheses #16207

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nicolo-ribaudo
Copy link
Member

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

There has been a lot of discussion in TC39 on what the precedence of throw expressions should be, and on when to require parentheses. That discussion is not settled yet, but you can read it at https://github.com/tc39/notes/blob/main/meetings/2023-09/september-26.md#throw-expressions-for-stage-3 + https://github.com/tc39/notes/blob/main/meetings/2023-09/september-28.md#throw-expression-continued (and slides at https://onedrive.live.com/view.aspx?resid=934F1675ED4C1638%21297369&authkey=!APFRcEQ8M_eUfds).

This PR implements one of the alternative (i.e. only allow throw expressions when directly inside parentheses), and I'm opening this as a draft just to avoid loosing it in old branches on my PC.

@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/56108/

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