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
commit 9422ae9bb2
Notes: sideshowbarker 2024-07-17 17:14:29 +09:00
11 changed files with 21 additions and 17 deletions

View file

@ -59,7 +59,7 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e
execution_context.realm = &m_realm;
// FIXME: How do we know if we're in strict mode? Maybe the Bytecode::Block should know this?
// execution_context.is_strict_mode = ???;
MUST(vm().push_execution_context(execution_context, global_object()));
vm().push_execution_context(execution_context);
pushed_execution_context = true;
}