fix corner case in dead_code (#5507)

fixes #5506
This commit is contained in:
Alex Lam S.L
2022-06-11 22:26:51 +01:00
committed by GitHub
parent 053cb27fe3
commit 99946a3993
4 changed files with 99 additions and 3 deletions

View File

@@ -1515,3 +1515,35 @@ issue_5456: {
expect_stdout: "foo"
node_version: ">=4"
}
issue_5506: {
options = {
dead_code: true,
}
input: {
console.log(function(a) {
var b = function*() {
a = null in (a = "PASS");
}();
try {
b.next();
} catch (e) {
return a;
}
}("FAIL"));
}
expect: {
console.log(function(a) {
var b = function*() {
a = null in (a = "PASS");
}();
try {
b.next();
} catch (e) {
return a;
}
}("FAIL"));
}
expect_stdout: "PASS"
node_version: ">=4"
}