fix corner case in merge_vars (#5424)

fixes #5423
This commit is contained in:
Alex Lam S.L
2022-04-19 09:04:06 +08:00
committed by GitHub
parent 1bc0fccc8c
commit fbdb7eeda3
2 changed files with 48 additions and 17 deletions

View File

@@ -3535,3 +3535,34 @@ issue_5405_2: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5423: {
options = {
merge_vars: true,
toplevel: true,
}
input: {
var a, b;
function f({
[function() {
if (++a)
return 42;
}()]: c
}) {}
f(b = f);
console.log(typeof b);
}
expect: {
var a, b;
function f({
[function() {
if (++a)
return 42;
}()]: c
}) {}
f(b = f);
console.log(typeof b);
}
expect_stdout: "function"
node_version: ">=6"
}