fix corner case in collapse_vars (#5574)

fixes #5573
This commit is contained in:
Alex Lam S.L
2022-07-23 00:18:26 +01:00
committed by GitHub
parent 56e9454f1f
commit b371dc2d1e
2 changed files with 29 additions and 1 deletions

View File

@@ -3817,3 +3817,30 @@ issue_5533_drop_fargs: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5573: {
options = {
collapse_vars: true,
}
input: {
var log = console.log;
var a = "FAIL";
(function([ { [log(a)]: b } ]) {
A = 42;
})((a = "PASS", [ {} ]));
log(a, A);
}
expect: {
var log = console.log;
var a = "FAIL";
(function([ { [log(a)]: b } ]) {
A = 42;
})((a = "PASS", [ {} ]));
log(a, A);
}
expect_stdout: [
"PASS",
"PASS 42",
]
node_version: ">=6"
}