fix corner cases in inline & unused (#4509)

fixes #4508
This commit is contained in:
Alex Lam S.L
2021-01-05 16:15:12 +00:00
committed by GitHub
parent 6eceac0966
commit 7ebfb22d16
3 changed files with 46 additions and 20 deletions

View File

@@ -2356,3 +2356,31 @@ issue_4504: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_4508: {
options = {
inline: true,
toplevel: true,
unused: true,
}
input: {
for (var i = 0; i < 2; i++)
(function f([ a ]) {
var a = console.log(a) && b, b = null;
})([ "PASS" ]);
}
expect: {
for (var i = 0; i < 2; i++)
[ [ a ] ] = [ [ "PASS" ] ],
b = void 0,
a = console.log(a) && b,
b = null,
void 0;
var a, b;
}
expect_stdout: [
"PASS",
"PASS",
]
node_version: ">=6"
}