fix corner case in ie8 & reduce_vars (#3706)

fixes #3703
This commit is contained in:
Alex Lam S.L
2020-02-05 20:03:22 +00:00
committed by GitHub
parent df506439b1
commit c93ca6ee53
2 changed files with 40 additions and 3 deletions

View File

@@ -2361,3 +2361,40 @@ issue_3542: {
}
expect_stdout: "1"
}
issue_3703: {
options = {
ie8: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
var a = "PASS";
function f() {
var b;
function g() {
a = "FAIL";
}
var c = g;
function h() {
f;
}
a ? b |= c : b.p;
}
f();
console.log(a);
}
expect: {
var a = "PASS";
(function() {
var b;
var c = function g() {
a = "FAIL";
};
a ? b |= c : b.p;
})();
console.log(a);
}
expect_stdout: "PASS"
}