fix corner case in evaluate (#3883)

fixes #3882
This commit is contained in:
Alex Lam S.L
2020-05-11 20:24:44 +01:00
committed by GitHub
parent e8a7956b6f
commit bd2f53bc8b
2 changed files with 34 additions and 3 deletions

View File

@@ -2369,3 +2369,29 @@ issue_3878_2: {
}
expect_stdout: "NaN"
}
issue_3882: {
options = {
evaluate: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
function f(a) {
return console.log(a++), a && this;
}
var b = f();
console.log(b);
}
expect: {
var b = function(a) {
return console.log(a++), a && this;
}();
console.log(b);
}
expect_stdout: [
"NaN",
"NaN",
]
}