mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:07:43 +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:
parent
50ad8d2a5a
commit
9422ae9bb2
11 changed files with 21 additions and 17 deletions
|
@ -31,7 +31,7 @@ WebContentConsoleClient::WebContentConsoleClient(JS::Console& console, WeakPtr<J
|
|||
// NOTE: We need to push an execution context here for NativeFunction::create() to succeed during global object initialization.
|
||||
// It gets removed immediately after creating the interpreter in Document::interpreter().
|
||||
auto& eso = verify_cast<Web::HTML::EnvironmentSettingsObject>(*m_interpreter->realm().host_defined());
|
||||
vm.push_execution_context(eso.realm_execution_context(), global_object);
|
||||
vm.push_execution_context(eso.realm_execution_context());
|
||||
console_global_object->initialize_global_object();
|
||||
vm.pop_execution_context();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue