summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorKenneth Myhra <kennethmyhra@gmail.com>2023-02-19 10:17:13 +0100
committerAndreas Kling <kling@serenityos.org>2023-02-22 09:55:33 +0100
commitb91d599177696bb1f5113d241ea172b1a212e8f7 (patch)
tree23a20a48c98f489ba37fa5b9ba1d13b35dc4b929 /Userland/Libraries
parentad13c45c288142cbd8cc4f64641ef183c99fd215 (diff)
downloadserenity-b91d599177696bb1f5113d241ea172b1a212e8f7.zip
LibWeb: Make factory method of UIEvents::FocusEvent fallible
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/UIEvents/FocusEvent.cpp4
-rw-r--r--Userland/Libraries/LibWeb/UIEvents/FocusEvent.h2
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<JS::NonnullGCPtr<FocusEvent>> FocusEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, FocusEventInit const& event_init)
{
- return realm.heap().allocate<FocusEvent>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors();
+ return MUST_OR_THROW_OOM(realm.heap().allocate<FocusEvent>(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<JS::NonnullGCPtr<FocusEvent>> construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, FocusEventInit const& event_init);
virtual ~FocusEvent() override;