1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:47:35 +00:00

LibJS/JIT: Continue to outer finally before returning

Fixes #21854
This commit is contained in:
Andreas Kling 2023-11-20 00:26:25 +01:00
parent 7ee47d81ca
commit 2372584b18
2 changed files with 23 additions and 3 deletions

View file

@ -9,3 +9,18 @@ test("return from try followed by finally with function call inside", () => {
expect(value).toBe(1);
});
test("return from outer finally with nested unwind contexts", () => {
let value = (() => {
try {
try {
return 1;
} finally {
}
} finally {
return 2;
}
})();
expect(value).toBe(2);
});