fix corner case in if_return (#5711)

fixes #5710
This commit is contained in:
Alex Lam S.L
2022-10-13 22:34:55 +01:00
committed by GitHub
parent 7edd10e5e5
commit 5411360829
2 changed files with 38 additions and 1 deletions

View File

@@ -2039,3 +2039,40 @@ issue_5707: {
expect_stdout: "PASS"
node_version: ">=6"
}
issue_5710: {
options = {
conditionals: true,
if_return: true,
}
input: {
(async function*() {
try {
switch (42) {
case 42:
{
if (console.log("PASS"))
return;
return null;
}
break;
}
} finally {}
})().next();
}
expect: {
(async function*() {
try {
switch (42) {
case 42:
if (console.log("PASS"))
return;
return null;
break;
}
} finally {}
})().next();
}
expect_stdout: "PASS"
node_version: ">=10"
}