summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2023-02-27 22:41:47 +0000
committerLinus Groh <mail@linusgroh.de>2023-02-27 23:57:08 +0000
commitaf118f2a679a7f21ca9389d1e2ae79f33fbf896a (patch)
tree5b9bb7e389abc41d2b0e4bc8a3e1fc3807c48946 /Userland/Libraries
parentfb7aaeff3e3c8d19ed1876e87e884a891fe41478 (diff)
downloadserenity-af118f2a679a7f21ca9389d1e2ae79f33fbf896a.zip
LibJS: Add missing error propagation to global object initializations
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/Realm.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp b/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp
index 0c066502e8..26dd2266f3 100644
--- a/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp
+++ b/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp
@@ -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());
}
diff --git a/Userland/Libraries/LibJS/Runtime/Realm.cpp b/Userland/Libraries/LibJS/Runtime/Realm.cpp
index a75aec04e4..e5c3bf0ea3 100644
--- a/Userland/Libraries/LibJS/Runtime/Realm.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Realm.cpp
@@ -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;
diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp
index 9d9d45ae05..e4a9f65319 100644
--- a/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmConstructor.cpp
@@ -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;