1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:17:34 +00:00

LibJS: Add missing error propagation to global object initializations

This commit is contained in:
Luke Wilde 2023-02-27 22:41:47 +00:00 committed by Linus Groh
parent fb7aaeff3e
commit af118f2a67
3 changed files with 3 additions and 3 deletions

View file

@ -65,7 +65,7 @@ JS_DEFINE_NATIVE_FUNCTION($262Object::create_realm)
VERIFY(realm_global_object);
realm->set_global_object(realm_global_object, nullptr);
set_default_global_bindings(*realm);
realm_global_object->initialize(*realm);
MUST_OR_THROW_OOM(realm_global_object->initialize(*realm));
return Value(realm_global_object->$262());
}

View file

@ -75,7 +75,7 @@ ThrowCompletionOr<NonnullOwnPtr<ExecutionContext>> Realm::initialize_host_define
auto& global_object = set_default_global_bindings(*realm);
// 11. Create any host-defined global object properties on globalObj.
global_object.initialize(*realm);
MUST_OR_THROW_OOM(global_object.initialize(*realm));
// 12. Return unused.
return new_context;

View file

@ -70,7 +70,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> ShadowRealmConstructor::construct(Functi
auto& global_object = set_default_global_bindings(object->shadow_realm());
// FIXME: 12. Perform ? HostInitializeShadowRealm(O.[[ShadowRealm]]).
global_object.initialize(object->shadow_realm());
MUST_OR_THROW_OOM(global_object.initialize(object->shadow_realm()));
// 13. Return O.
return object;