fix corner case in rename (#4000)

fixes #3999
This commit is contained in:
Alex Lam S.L
2020-06-15 01:29:01 +08:00
committed by GitHub
parent ae9f56be10
commit 8b2cfd45fa
2 changed files with 41 additions and 7 deletions

View File

@@ -2223,13 +2223,13 @@ issue_3523_rename_ie8: {
expect: {
var a = 0, b, c = "FAIL";
(function() {
var c, n, t, o, a, r, f, i, u, e, h, l, v, y;
var c, n, t, o, a, r, e, f, i, u, h, l, v, y;
})();
try {
throw 0;
} catch (e) {
(function() {
(function n() {
(function e() {
c = "PASS";
})();
})();
@@ -2522,3 +2522,40 @@ issue_3918: {
}
expect_stdout: "PASS"
}
issue_3999: {
rename = true
mangle = {
ie8: true,
}
input: {
(function() {
(function f() {
for (var i = 0; i < 2; i++)
try {
f[0];
} catch (f) {
var f = 0;
console.log(i);
}
})();
})(typeof f);
}
expect: {
(function() {
(function f() {
for (var c = 0; c < 2; c++)
try {
f[0];
} catch (f) {
var f = 0;
console.log(c);
}
})();
})(typeof f);
}
expect_stdout: [
"0",
"1",
]
}