-
-
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
Nested function with shadowed variable bug #348
Comments
@fabiosantoscode, could you provide some insights were the bug might be located? Maybe I'll be able to dig a little bit into it and try to fix it. |
The standard procedure is to disable the "defaults" option so that you can enable and disable compress options, which act as feature flags for Terser. When you find the feature that's actually guilty of this change, you grep for it in the |
But the only thing that is used is |
The weird thing is that with the function x(n) {
return function(n) {
if (n) {
const t = n;
if (t) return t;
}
}(n);
} |
I guess that the error is somewhere in the |
I guess that the last ones cause the error ( |
Yes, it's certainly collapse_vars. When I start terser with |
Managed to close this by being a tad more conservative around variable redefinitions. Could've increased the complexity of the code somewhat but I don't feel it's necessary at all. |
Bug report or Feature request?
Bug report
Version (complete output of
terser -V
)3.17.0
Complete CLI command or
minify()
options usedterser
inputterser
output or errorExpected result
The text was updated successfully, but these errors were encountered: