fix corner case in awaits & inline (#5259)

fixes #5258
This commit is contained in:
Alex Lam S.L
2022-01-03 12:57:24 +00:00
committed by GitHub
parent 1a054e869e
commit dec359ce58
2 changed files with 70 additions and 2 deletions

View File

@@ -2605,3 +2605,59 @@ issue_5250: {
]
node_version: ">=8"
}
issue_5258_1: {
options = {
awaits: true,
inline: true,
}
input: {
(async function() {
(async function() {
throw "FAIL";
})();
return "PASS";
})().catch(console.log).then(console.log);
}
expect: {
(async function() {
(async function() {
throw "FAIL";
})();
return "PASS";
})().catch(console.log).then(console.log);
}
expect_stdout: "PASS"
node_version: ">=8"
}
issue_5258_2: {
options = {
awaits: true,
inline: true,
}
input: {
function f() {
throw "FAIL";
}
(async function() {
(async function() {
f();
})();
return "PASS";
})().catch(console.log).then(console.log);
}
expect: {
function f() {
throw "FAIL";
}
(async function() {
(async function() {
f();
})();
return "PASS";
})().catch(console.log).then(console.log);
}
expect_stdout: "PASS"
node_version: ">=8"
}