enhance merge_vars (#4152)

This commit is contained in:
Alex Lam S.L
2020-09-25 15:00:20 +01:00
committed by GitHub
parent af35cd32f2
commit 6e105c5ca6
2 changed files with 23 additions and 3 deletions

View File

@@ -2800,3 +2800,25 @@ lambda_reuse: {
"string",
]
}
conditional_write: {
options = {
merge_vars: true,
toplevel: true,
}
input: {
var a = "FAIL", b;
if (console)
a = "PASS";
b = [a, 42].join();
console.log(b);
}
expect: {
var b = "FAIL", b;
if (console)
b = "PASS";
b = [b, 42].join();
console.log(b);
}
expect_stdout: "PASS,42"
}