fix corner case in unused (#4457)

fixes #4456
This commit is contained in:
Alex Lam S.L
2020-12-25 12:10:58 +00:00
committed by GitHub
parent f345175bc2
commit a1b2735dd8
2 changed files with 39 additions and 8 deletions

View File

@@ -2164,3 +2164,36 @@ issue_4446: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_4456: {
options = {
pure_getters: true,
unused: true,
}
input: {
var o = {
set p(v) {
console.log(v);
},
};
[ function() {
try {
return o;
} catch ({}) {}
}().p ] = [ "PASS" ];
}
expect: {
var o = {
set p(v) {
console.log(v);
},
};
[ function() {
try {
return o;
} catch ({}) {}
}().p ] = [ "PASS" ];
}
expect_stdout: "PASS"
node_version: ">=6"
}