-
-
Notifications
You must be signed in to change notification settings - Fork 374
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
Incorrect const A
declaration after a class B extends A
is moved and becomes unnamed during minification
#627
Comments
Nasty! I'll have a look right away. |
I think I encountered the same issue. This happens since 4.6.8. Chrome Console says: Uncaught SyntaxError: Missing initializer in const declaration
I havent looked up the source as it occurs in a library I use (Polymer) |
That does the trick 🎉 Thanks for the quick fix @fabiosantoscode! |
I'm waiting for the functional tests to ship 4.6.10 |
Thanks a lot for the quick fix! |
Bug report or Feature request?
Bug report.
Version (complete output of
terser -V
or specific git commit)According to
git bisect
, this regressed in 0e40b8d.Complete CLI command or
minify()
options usedterser
inputFrom my tests, it seems to only happen with a combination of factors:
HtmlContent
variable is used in a class'sextends
nodeBreadcrumbPanel
) is namedBreadcrumbPanel
) becomes anonymous during minification, and/or the class that it is used in is moved during minification (tomodule.exports = class {}
)For example, using the
HtmlContent
value in these patterns do not have this bug:terser
output or errorThe initializer is separated from the
const
declaration by a semicolon, which is invalid:Expected result
The text was updated successfully, but these errors were encountered: