1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:57:45 +00:00

LibJS: Convert push_execution_context() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-11-14 12:20:49 +00:00
parent 7cdca08090
commit 57de5056b6
10 changed files with 20 additions and 21 deletions

View file

@ -98,14 +98,14 @@ public:
#endif
}
void push_execution_context(ExecutionContext& context, GlobalObject& global_object)
ThrowCompletionOr<void> push_execution_context(ExecutionContext& context, GlobalObject& global_object)
{
VERIFY(!exception());
// Ensure we got some stack space left, so the next function call doesn't kill us.
if (did_reach_stack_space_limit())
throw_exception<Error>(global_object, ErrorType::CallStackSizeExceeded);
else
m_execution_context_stack.append(&context);
return throw_completion<Error>(global_object, ErrorType::CallStackSizeExceeded);
m_execution_context_stack.append(&context);
return {};
}
void pop_execution_context()