fix corner case in conditionals (#5723)

fixes #5722
This commit is contained in:
Alex Lam S.L
2022-10-28 17:17:59 +01:00
committed by GitHub
parent 30bf068768
commit 7270671687
2 changed files with 29 additions and 5 deletions

View File

@@ -3068,3 +3068,23 @@ issue_5712: {
}
expect_stdout: "PASS"
}
issue_5722: {
options = {
conditionals: true,
evaluate: true,
keep_fnames: true,
side_effects: true,
}
input: {
var a = true;
a && function f() {
return 42;
}(a++) ? null + (console.log("PASS") && a++) : "";
}
expect: {
var a = true;
a && (void a++, console.log("PASS")) && a++;
}
expect_stdout: "PASS"
}