fix corner case in evaluate (#3569)

This commit is contained in:
Alex Lam S.L
2019-11-04 13:13:48 +08:00
committed by GitHub
parent 0f2687ecfc
commit 0e29ad5eb9
2 changed files with 29 additions and 1 deletions

View File

@@ -1876,3 +1876,27 @@ issue_3558: {
}
expect_stdout: "1 0"
}
issue_3568: {
options = {
evaluate: true,
reduce_vars: true,
toplevel: true,
unsafe: true,
}
input: {
var a = 0;
function f(b) {
return b && b.p;
}
console.log(f(++a + f()));
}
expect: {
var a = 0;
function f(b) {
return b && b.p;
}
console.log(NaN);
}
expect_stdout: "NaN"
}