fix corner case in ie8 (#4187)

fixes #4186
This commit is contained in:
Alex Lam S.L
2020-10-06 02:20:41 +01:00
committed by GitHub
parent b91a2459c0
commit bc6e105174
5 changed files with 129 additions and 37 deletions

View File

@@ -2819,3 +2819,43 @@ direct_inline_catch_redefined: {
}
expect_stdout: true
}
issue_4186: {
options = {
dead_code: true,
evaluate: true,
ie8: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
mangle = {
ie8: true,
toplevel: true,
}
input: {
function f() {
(function NaN() {
var a = 1;
while (a--)
try {} finally {
console.log(0/0);
var b;
}
})(f);
}
f();
NaN;
}
expect: {
(function() {
(function NaN() {
var n = 1;
while (n--)
console.log(0/0);
})();
})();
NaN;
}
expect_stdout: "NaN"
}