fix corner case in dead_code (#4571)

fixes #4570
This commit is contained in:
Alex Lam S.L
2021-01-19 01:33:57 +00:00
committed by GitHub
parent 994293e972
commit 90ec468240
2 changed files with 19 additions and 1 deletions

View File

@@ -1399,3 +1399,21 @@ issue_4366: {
expect_stdout: "PASS"
node_version: ">=4"
}
issue_4570: {
options = {
dead_code: true,
inline: true,
}
input: {
var a = function(b) {
return a += b;
}() ? 0 : a;
console.log(a);
}
expect: {
var a = (a += void 0) ? 0 : a;
console.log(a);
}
expect_stdout: "NaN"
}