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 BadStatement case to walk.go to avoid panic #495

Merged
merged 1 commit into from
May 20, 2023

Conversation

amaicode
Copy link
Contributor

This PR is to address what I think might have been an oversight in the ast package walk.go file.

When the switch runs across a BadStatement node, this causes it to default (and panic).

I have added an empty case for this node type similar to BadExpression to get around this as well as a unit test.

@stevenh
Copy link
Collaborator

stevenh commented May 19, 2023

If you rebase to master, I fixed the lint issues @amaicode

@amaicode
Copy link
Contributor Author

If you rebase to master, I fixed the lint issues @amaicode

Just rebased :)

@stevenh stevenh merged commit f987875 into robertkrimen:master May 20, 2023
2 checks passed
sg3des pushed a commit to sg3des/otto that referenced this pull request Jul 17, 2023
Add BadStatement case to walk.go to fix panic if there's bad code.
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