fix corner case in awaits (#4988)

fixes #4987
This commit is contained in:
Alex Lam S.L
2021-05-30 06:40:13 +01:00
committed by GitHub
parent 23b9f36bd8
commit 55a230daa8
2 changed files with 38 additions and 4 deletions

View File

@@ -1726,3 +1726,35 @@ issue_4975: {
expect_stdout: "object"
node_version: ">=8"
}
issue_4987: {
options = {
awaits: true,
side_effects: true,
}
input: {
(async function() {
try {
await 42;
} finally {
console.log("foo");
}
})();
console.log("bar");
}
expect: {
(async function() {
try {
await 0;
} finally {
console.log("foo");
}
})();
console.log("bar");
}
expect_stdout: [
"bar",
"foo",
]
node_version: ">=8"
}