fix corner case in conditionals (#4948)

fixes #4947
This commit is contained in:
Alex Lam S.L
2021-05-20 11:08:22 +01:00
committed by GitHub
parent e0695ef549
commit 4a19575e74
2 changed files with 31 additions and 0 deletions

View File

@@ -275,3 +275,33 @@ issue_4928: {
expect_stdout: "undefined"
node_version: ">=14"
}
issue_4947_1: {
options = {
conditionals: true,
}
input: {
console.log(console.foo ? 42..p : console.bar?.p);
}
expect: {
console.log(console.foo ? 42..p : console.bar?.p);
}
expect_stdout: "undefined"
node_version: ">=14"
}
issue_4947_2: {
options = {
conditionals: true,
}
input: {
var log = console.log, fail;
log("PASS") ? log(42) : fail?.(42);
}
expect: {
var log = console.log, fail;
log("PASS") ? log(42) : fail?.(42);
}
expect_stdout: "PASS"
node_version: ">=14"
}