fix corner case in merge_vars (#5092)

fixes #5091
This commit is contained in:
Alex Lam S.L
2021-07-20 19:47:53 +01:00
committed by GitHub
parent 8926a2f327
commit 7fac839c62
2 changed files with 44 additions and 5 deletions

View File

@@ -327,3 +327,29 @@ issue_5039: {
expect_stdout: "PASS"
node_version: ">=14"
}
issue_5091: {
options = {
merge_vars: true,
}
input: {
function f(a) {
var b = a.p;
var c;
b?.[c = "FAIL 2"];
return b || c;
}
console.log(f("FAIL 1") || "PASS");
}
expect: {
function f(b) {
var b = b.p;
var c;
b?.[c = "FAIL 2"];
return b || c;
}
console.log(f("FAIL 1") || "PASS");
}
expect_stdout: "PASS"
node_version: ">=14"
}