fix corner case in evaluate (#4215)

fixes #4214
This commit is contained in:
Alex Lam S.L
2020-10-13 19:49:45 +01:00
committed by GitHub
parent c0c04c33bb
commit b7b8435721
2 changed files with 38 additions and 3 deletions

View File

@@ -3014,3 +3014,36 @@ issue_4119_4: {
}
expect_stdout: "PASS"
}
issue_4214: {
options = {
evaluate: true,
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
function f(a) {
return function() {
try {
return a;
} finally {
var b = 0;
}
}(a++ && this());
}
var c = f();
console.log(c);
}
expect: {
var c = function(a) {
return function() {
try {
return a;
} finally {}
}(a++ && this());
}();
console.log(c);
}
expect_stdout: "NaN"
}