fix corner case in unused (#3665)

fixes #3664
This commit is contained in:
Alex Lam S.L
2020-01-01 20:24:30 +08:00
committed by GitHub
parent d83d3d741a
commit 746f5f6c62
2 changed files with 21 additions and 1 deletions

View File

@@ -2335,3 +2335,23 @@ function_parameter_ie8: {
}
expect_stdout: "PASS"
}
issue_3664: {
options = {
pure_getters: "strict",
unused: true,
}
input: {
console.log(function() {
var a, b = (a = (a = [ b && console.log("FAIL") ]).p = 0, 0);
return "PASS";
}());
}
expect: {
console.log(function() {
var b = ([ b && console.log("FAIL") ].p = 0, 0);
return "PASS";
}());
}
expect_stdout: "PASS"
}