fix corner case in loops & unused (#4356)

fixes #4355
This commit is contained in:
Alex Lam S.L
2020-12-10 07:45:39 +00:00
committed by GitHub
parent 046bbde9d4
commit a59593cac8
3 changed files with 79 additions and 22 deletions

View File

@@ -1777,3 +1777,32 @@ issue_4323: {
expect_stdout: "function"
node_version: ">=6"
}
issue_4355: {
options = {
loops: true,
unused: true,
}
input: {
var a;
(function({
[function() {
for (a in "foo");
}()]: b,
}) {
var a;
})(0);
console.log(a);
}
expect: {
var a;
(function({
[function() {
for (a in "foo");
}()]: b,
}) {})(0);
console.log(a);
}
expect_stdout: "2"
node_version: ">=6"
}