fix corner case in collapse_vars (#4002)

fixes #4001
This commit is contained in:
Alex Lam S.L
2020-06-19 19:19:37 +01:00
committed by GitHub
parent 8b2cfd45fa
commit e61bc34eb1
2 changed files with 34 additions and 2 deletions

View File

@@ -2559,3 +2559,37 @@ issue_3999: {
"1",
]
}
issue_4001: {
options = {
collapse_vars: true,
ie8: true,
inline: true,
reduce_vars: true,
sequences: true,
toplevel: true,
unused: true,
}
input: {
console.log(function(a) {
function f() {
return a;
var b;
}
var c = f();
(function g() {
c[42];
f;
})();
(function a() {});
}(42));
}
expect: {
function f() {
return a;
}
var a;
console.log((a = 42, void f()[42], void function a() {}));
}
expect_stdout: "undefined"
}