fix corner case in collapse_vars (#5169)

fixes #5168
This commit is contained in:
Alex Lam S.L
2021-11-13 14:18:18 +00:00
committed by GitHub
parent eaa84d32df
commit e9932e1314
2 changed files with 30 additions and 2 deletions

View File

@@ -3225,3 +3225,31 @@ issue_5153_object_var: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5168: {
options = {
collapse_vars: true,
}
input: {
(function a({
[console.log(typeof function() {
++a;
return a;
}())]: b,
}) {
var a;
})({});
}
expect: {
(function a({
[console.log(typeof function() {
++a;
return a;
}())]: b,
}) {
var a;
})({});
}
expect_stdout: "function"
node_version: ">=6"
}