From b91d599177696bb1f5113d241ea172b1a212e8f7 Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Sun, 19 Feb 2023 10:17:13 +0100 Subject: [PATCH] LibWeb: Make factory method of UIEvents::FocusEvent fallible --- Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp | 4 ++-- Userland/Libraries/LibWeb/UIEvents/FocusEvent.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp index b5f4360e23..60ea1fb0c4 100644 --- a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp @@ -9,9 +9,9 @@ namespace Web::UIEvents { -FocusEvent* FocusEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, FocusEventInit const& event_init) +WebIDL::ExceptionOr> FocusEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, FocusEventInit const& event_init) { - return realm.heap().allocate(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors(); + return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm, event_name, event_init)); } FocusEvent::FocusEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, FocusEventInit const& event_init) diff --git a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h index 1ef560ca9a..48a2ab326d 100644 --- a/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/FocusEvent.h @@ -18,7 +18,7 @@ class FocusEvent final : public UIEvent { WEB_PLATFORM_OBJECT(FocusEvent, UIEvent); public: - static FocusEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, FocusEventInit const& event_init); + static WebIDL::ExceptionOr> construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, FocusEventInit const& event_init); virtual ~FocusEvent() override;