fix corner case in sign propagation (#3696)

- migrate de-facto functionality to `evaluate`

fixes #3695
This commit is contained in:
Alex Lam S.L
2020-01-28 22:44:18 +08:00
committed by GitHub
parent b499e03f82
commit 87119e44a0
3 changed files with 30 additions and 9 deletions

View File

@@ -669,6 +669,9 @@ issue_1710: {
}
unary_binary_parenthesis: {
options = {
evaluate: true,
}
input: {
var v = [ 0, 1, NaN, Infinity, null, undefined, true, false, "", "foo", /foo/ ];
v.forEach(function(x) {
@@ -1233,3 +1236,18 @@ issue_3684: {
"Infinity",
]
}
issue_3695: {
options = {
evaluate: true,
}
input: {
var a = [];
console.log(+(a * (a[0] = false)));
}
expect: {
var a = [];
console.log(+(a * (a[0] = false)));
}
expect_stdout: "NaN"
}