-
Notifications
You must be signed in to change notification settings - Fork 64
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
Regression: if
without braces, followed by const
or let
immediately after the semicolon, produces broken code
#132
Comments
if
without braces, followed immediately by const
or let
on the same line, produces broken codeif
without braces, followed by const
or let
immediately after the semicolon, produces broken code
Looking at this commit this regressed in, it’s clearly related to upgrading magic-string from 0.14.0 to 0.22.4. It seems to me more likely that this is a bug in magic-string than buble itself, but I’m sufficiently uncertain about it all that this is the best place to file and track it. |
Why do you minify before Bublé? |
@aleclarson Not that it particularly matters—this being a rather severe regression on legitimate code—but there are two main reasons why minified code may be fed through Bublé. I hit both of them.
|
Thanks for your report, I could easily reproduce the issue.
I obviously suspected the const transform to be the issue, so I deactivated it, and got valid output:
So I checked |
This regressed between 1.16.0 and 1.17.0, in 40baf2e.
Minimal test case:
This produces:
Before 40baf2e, it produced this:
Any whitespace after the semicolon, and it compiles correctly; it’s only if the semicolon is immediately followed by
let
orconst
that it breaks.for
andwhile
also exhibit this bug.I feed some minified code through bublé; I hit this when upgrading from 1.15.2 to the latest and it all stopped working.
The text was updated successfully, but these errors were encountered: