fix corner cases in unused (#5073)

fixes #5071
This commit is contained in:
Alex Lam S.L
2021-07-11 07:52:38 +01:00
committed by GitHub
parent 64ebf6efe9
commit 1ad830facb
2 changed files with 56 additions and 19 deletions

View File

@@ -2783,3 +2783,36 @@ issue_5017: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5071_1: {
options = {
unused: true,
}
input: {
var a;
console.log(([ , a ] = [ "PA", , ]).join("SS"));
}
expect: {
var a;
console.log(([ , a ] = [ "PA", , ]).join("SS"));
}
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5071_2: {
options = {
pure_getters: "strict",
unused: true,
}
input: {
var a;
([ a ] = []).p = console.log("PASS");
}
expect: {
var a;
([ a ] = []).p = console.log("PASS");
}
expect_stdout: "PASS"
node_version: ">=6"
}