-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Empty statements unexpectedly removed. #931
Comments
mbostock
added a commit
to d3/d3-path
that referenced
this issue
Sep 12, 2016
mbostock
added a commit
to d3/d3-time
that referenced
this issue
Sep 12, 2016
@Rich-Harris I don't know if |
eventualbuddha
added a commit
that referenced
this issue
Sep 13, 2016
When used as part of another statement, such as an `IfStatement`, they can be semantically meaningful. Fixes #931
Fixed in v0.35.10. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I expected the following code to be unchanged by Rollup:
However, the resulting output drops the semicolon from the if block, resulting in invalid JavaScript:
You can workaround this issue by using an empty block instead of an empty statement:
Naturally, the problem also applies to else-if and else:
Which results in:
This example is slightly more complicated than it should be (using the IIFE) because #930 was causing the simpler test case to be removed entirely.
The text was updated successfully, but these errors were encountered: