fix corner case in if_return (#5650)

fixes #5649
This commit is contained in:
Alex Lam S.L
2022-09-08 03:49:05 +01:00
committed by GitHub
parent 32bd65a87f
commit 4e4a2f8ed3
2 changed files with 35 additions and 8 deletions

View File

@@ -2385,3 +2385,30 @@ issue_5619_2: {
}
expect_stdout: "PASS"
}
issue_5649: {
options = {
if_return: true,
}
input: {
console.log(function() {
try {
throw new Error("FAIL");
} catch (e) {
return "PASS";
}
throw new Error("FAIL");
}());
}
expect: {
console.log(function() {
try {
throw new Error("FAIL");
} catch (e) {
return "PASS";
}
throw new Error("FAIL");
}());
}
expect_stdout: "PASS"
}