fix corner case in unused (#5706)

fixes #5705
This commit is contained in:
Alex Lam S.L
2022-10-10 01:02:23 +01:00
committed by GitHub
parent ed7051b9bb
commit bccb1c3bd9
3 changed files with 22 additions and 7 deletions

View File

@@ -1624,3 +1624,21 @@ issue_5552_4: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5705: {
options = {
reduce_vars: true,
rests: true,
unused: true,
}
input: {
(function(...a) {
var b = { ...a };
})(console.log("PASS"));
}
expect: {
(function() {})(console.log("PASS"));
}
expect_stdout: "PASS"
node_version: ">=8.3.0"
}