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

Fix parser crash on blocks inside switch #1640

Merged
merged 1 commit into from
Dec 7, 2024
Merged

Fix parser crash on blocks inside switch #1640

merged 1 commit into from
Dec 7, 2024

Conversation

STRd6
Copy link
Contributor

@STRd6 STRd6 commented Dec 7, 2024

Fixes #1637

node is sometimes the Statement tuple so using exp which is always the actual block. TS actually caught the error.

Note that this is being interpreted as a block statement not an object literal at present.

Copy link
Collaborator

@edemaine edemaine left a comment

Choose a reason for hiding this comment

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

Whoops! Good catch. This PR should also fix the labeled statement case.

@STRd6 STRd6 merged commit 25ce894 into main Dec 7, 2024
4 checks passed
@STRd6 STRd6 deleted the 1637 branch December 7, 2024 16:30
@edemaine edemaine changed the title Fix #1637: prevent parser crash on blocks inside switch Fix parser crash on blocks inside switch Dec 7, 2024
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.

TypeError with object literal in switch?
2 participants