From 3d79cdf09599f0a5f85fe73656ad79b8814d528b Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Sun, 12 Feb 2023 21:30:29 +0100 Subject: [PATCH] LibWeb: Make factory method of HTML::MessageChannel fallible --- Userland/Libraries/LibWeb/HTML/MessageChannel.cpp | 4 ++-- Userland/Libraries/LibWeb/HTML/MessageChannel.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp b/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp index 1371d63877..55eb3f5fa5 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessageChannel.cpp @@ -11,9 +11,9 @@ namespace Web::HTML { -JS::NonnullGCPtr MessageChannel::construct_impl(JS::Realm& realm) +WebIDL::ExceptionOr> MessageChannel::construct_impl(JS::Realm& realm) { - return realm.heap().allocate(realm, realm).release_allocated_value_but_fixme_should_propagate_errors(); + return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm)); } MessageChannel::MessageChannel(JS::Realm& realm) diff --git a/Userland/Libraries/LibWeb/HTML/MessageChannel.h b/Userland/Libraries/LibWeb/HTML/MessageChannel.h index ac472971cb..61b5ea47c3 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageChannel.h +++ b/Userland/Libraries/LibWeb/HTML/MessageChannel.h @@ -16,7 +16,7 @@ class MessageChannel final : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(MessageChannel, Bindings::PlatformObject); public: - static JS::NonnullGCPtr construct_impl(JS::Realm&); + static WebIDL::ExceptionOr> construct_impl(JS::Realm&); virtual ~MessageChannel() override; MessagePort* port1();