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

print doesn't handle statements with empty bodies correctly #65

Closed
Conduitry opened this issue Oct 29, 2021 · 0 comments · Fixed by #66
Closed

print doesn't handle statements with empty bodies correctly #65

Conduitry opened this issue Oct 29, 2021 · 0 comments · Fixed by #66
Labels
bug Something isn't working

Comments

@Conduitry
Copy link
Collaborator

Downstream issue: sveltejs/svelte#6884

Generating an AST from something like while (foo()); bar(); and then serializing it back into a string results in while (foo()) bar();, presumably because node.body on the WhileStatement is undefined, and so nothing gets emitted for it, which is incorrect in this case. There are other statement types that are also affected by this (ForStatement, IfStatement, maybe others) and we should take a sweep through all of them to see which might be suffering from the same bug.

@Conduitry Conduitry added the bug Something isn't working label Oct 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant