fix corner case in ie8 (#3824)

fixes #3823
This commit is contained in:
Alex Lam S.L
2020-04-26 23:44:53 +01:00
committed by GitHub
parent a4a8ccea8c
commit bc2a4a3bb8
2 changed files with 58 additions and 14 deletions

View File

@@ -2420,3 +2420,28 @@ issue_3750: {
}
expect_stdout: "PASS"
}
issue_3823: {
options = {
ie8: true,
toplevel: true,
unused: true,
}
input: {
for (var i = 0; i < 1; i++) {
var a = a ? function f() {
f;
} : 0;
console.log("PASS", typeof f);
}
}
expect: {
for (var i = 0; i < 1; i++) {
(function f() {
f;
});
console.log("PASS", typeof f);
}
}
expect_stdout: "PASS undefined"
}