fix corner case in booleans (#3691)

fixes #3690
This commit is contained in:
Alex Lam S.L
2020-01-28 02:04:44 +08:00
committed by GitHub
parent 36a430cd1e
commit 0dcedad2d5
2 changed files with 24 additions and 2 deletions

View File

@@ -131,3 +131,25 @@ issue_3658: {
}
expect_stdout: "PASS"
}
issue_3690: {
options = {
booleans: true,
unused: true,
}
input: {
console.log(function(a) {
return function() {
return a = [ this ];
}() ? "PASS" : "FAIL";
}());
}
expect: {
console.log(function(a) {
return function() {
return 1;
}() ? "PASS" : "FAIL";
}());
}
expect_stdout: "PASS"
}