-
-
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
[bug] immediately invoked function and variable-name collision #354
Labels
Comments
With the outer function dropped - works:
(function() {
window.used = (function() {
var A = window.foo,
B = window.bar,
C = window.foobar;
return (function(A, c) {
if (-1 === c) return A;
return $(A, c);
})(B, C);
})();
})();
window.used = (function() {
window.foo;
var B = window.bar,
C = window.foobar;
return -1 === C ? B : $(B, C);
})(); (Prettified) |
With the unused variable,
(function(callback) {
callback();
})(function() {
window.used = (function() {
var X = window.foo,
B = window.bar,
C = window.foobar;
return (function(A, c) {
if (-1 === c) return A;
return $(A, c);
})(B, C);
})();
});
window.used = (function() {
window.foo;
var A,
c,
B = window.bar,
C = window.foobar;
return (A = B), -1 === (c = C) ? A : $(A, c);
})(); (Prettified) |
This was referenced May 30, 2019
Oh my, this looks like a tough and serious one. Thanks for the repro :) |
@fabiosantoscode looks a little like #294 and #308 and there is already MR for that: #320 |
Damn, I got my hopes up :( |
Hey, dont give it up! |
Sorry :( |
PR created |
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
My second attempt on reproducing this bug... (first attempt: #352).
I think I got it this time around...
No idea what to title this issue though...
Version (complete output of
terser -V
or specific git commit)terser 4.0.0
Complete CLI command or
minify()
options usedterser --compress
terser
inputterser
output(Prettified)
Notice the missing
if
.Expected result
(Prettified)
The text was updated successfully, but these errors were encountered: