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

@ -160,7 +160,7 @@ void Worker::run_a_worker(AK::URL& url, EnvironmentSettingsObject& outside_setti
m_execution_context.variable_environment = &m_worker_realm->global_environment();
m_execution_context.realm = m_worker_realm;
m_worker_vm->push_execution_context(m_execution_context, *m_worker_scope);
m_worker_vm->push_execution_context(m_execution_context);
m_worker_realm->set_global_object(*m_worker_scope, m_worker_scope);
// 8. Let worker global scope be the global object of realm execution context's Realm component.