1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 18:15:06 +00:00

LibJS: Add infallible variant of VM::push_execution_context()

It makes no sense to require passing a global object and doing a stack
space check in some cases where running out of stack is highly unlikely,
we can't recover from errors, and currently ignore the result anyway.

This is most commonly in constructors and when setting things up, rather
than regular function calls.
This commit is contained in:
Linus Groh 2022-03-17 22:40:17 +00:00 committed by Andreas Kling
parent 50ad8d2a5a
commit 9422ae9bb2
11 changed files with 21 additions and 17 deletions

View file

@ -78,7 +78,7 @@ RunScriptDecision EnvironmentSettingsObject::can_run_script()
void EnvironmentSettingsObject::prepare_to_run_script()
{
// 1. Push settings's realm execution context onto the JavaScript execution context stack; it is now the running JavaScript execution context.
global_object().vm().push_execution_context(realm_execution_context(), global_object());
global_object().vm().push_execution_context(realm_execution_context());
// FIXME: 2. Add settings to the currently running task's script evaluation environment settings object set.
}