mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibJS: Handle call stack limit exceptions in NewPromiseReactionJob
The promise job's fulfillment / rejection handlers may push an execution context onto the VM, which will throw an internal error if our ad-hoc call stack size limit has been reached. Thus, we cannot blindly VERIFY that the result of invoking these handlers is non-abrupt. This patch will propagate any internal error forward, and retains the condition that any other error type is not thrown.
This commit is contained in:
parent
b91a0f5403
commit
911b915763
Notes:
github-actions[bot]
2025-02-05 13:06:00 +00:00
Author: https://github.com/trflynn89
Commit: 911b915763
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3450
Reviewed-by: https://github.com/shannonbooth ✅
2 changed files with 13 additions and 1 deletions
|
@ -18,4 +18,16 @@ test("infinite recursion", () => {
|
|||
expect(() => {
|
||||
new Proxy({}, { get: (_, __, p) => p.foo }).foo;
|
||||
}).toThrowWithMessage(InternalError, "Call stack size limit exceeded");
|
||||
|
||||
expect(() => {
|
||||
function outer() {
|
||||
async function inner() {
|
||||
await outer;
|
||||
}
|
||||
inner();
|
||||
outer();
|
||||
}
|
||||
|
||||
outer();
|
||||
}).toThrowWithMessage(InternalError, "Call stack size limit exceeded");
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue