fix corner case in conditionals (#4492)

This commit is contained in:
Alex Lam S.L
2021-01-01 23:53:15 +00:00
committed by GitHub
parent 0417a69c3e
commit dfb86ccdd1
2 changed files with 32 additions and 3 deletions

View File

@@ -85,6 +85,28 @@ collapse_vars_4: {
node_version: ">=6"
}
conditionals_farg: {
options = {
conditionals: true,
}
input: {
function log(msg) {
console.log(msg);
}
var a = 42, b = [ "PASS" ], c = [ "FAIL" ];
a ? log(...b) : log(...c);
}
expect: {
function log(msg) {
console.log(msg);
}
var a = 42, b = [ "PASS" ], c = [ "FAIL" ];
log(...a ? b : c);
}
expect_stdout: "PASS"
node_version: ">=6"
}
dont_inline: {
options = {
inline: true,