fix corner case with collapse_vars & ie8 (#3469)

fixes #3468
This commit is contained in:
Alex Lam S.L
2019-10-14 13:34:35 +08:00
committed by GitHub
parent e8ab0a44b2
commit a39bdb5840
3 changed files with 47 additions and 2 deletions

View File

@@ -969,3 +969,47 @@ issue_3355_4: {
}
expect_stdout: "PASS"
}
issue_3468: {
options = {
collapse_vars: true,
ie8: false,
}
input: {
var a = 42;
console.log(function a() {
a++;
return typeof a;
}());
}
expect: {
var a = 42;
console.log(function a() {
a++;
return typeof a;
}());
}
expect_stdout: "function"
}
issue_3468_ie8: {
options = {
collapse_vars: true,
ie8: true,
}
input: {
var a = 42;
console.log(function a() {
a++;
return typeof a;
}());
}
expect: {
var a = 42;
console.log(function a() {
a++;
return typeof a;
}());
}
expect_stdout: "function"
}