summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM/Event.cpp
diff options
context:
space:
mode:
authorKenneth Myhra <kennethmyhra@gmail.com>2023-02-14 22:43:17 +0100
committerLinus Groh <mail@linusgroh.de>2023-02-18 00:52:47 +0100
commitc120c46acc4bc12fa8f3f9ed5f9f953626d3cf9e (patch)
tree2580e04e199646f6885bd276954811bf25061302 /Userland/Libraries/LibWeb/DOM/Event.cpp
parent0d9076c9f57bb5eba064a803241e9d25843b58f1 (diff)
downloadserenity-c120c46acc4bc12fa8f3f9ed5f9f953626d3cf9e.zip
LibWeb: Make factory methods of DOM::Event fallible
Because of interdependencies between DOM::Event and UIEvents::MouseEvent to template function fire_an_event() in WebDriverConnection.cpp, the commit: 'LibWeb: Make factory methods of UIEvents::MouseEvent fallible' have been squashed into this commit.
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Event.cpp')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Event.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Event.cpp b/Userland/Libraries/LibWeb/DOM/Event.cpp
index 554e7cb1c5..4609fd7f6f 100644
--- a/Userland/Libraries/LibWeb/DOM/Event.cpp
+++ b/Userland/Libraries/LibWeb/DOM/Event.cpp
@@ -14,12 +14,12 @@
namespace Web::DOM {
-JS::NonnullGCPtr<Event> Event::create(JS::Realm& realm, DeprecatedFlyString const& event_name, EventInit const& event_init)
+WebIDL::ExceptionOr<JS::NonnullGCPtr<Event>> Event::create(JS::Realm& realm, DeprecatedFlyString const& event_name, EventInit const& event_init)
{
- return realm.heap().allocate<Event>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors();
+ return MUST_OR_THROW_OOM(realm.heap().allocate<Event>(realm, realm, event_name, event_init));
}
-JS::NonnullGCPtr<Event> Event::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, EventInit const& event_init)
+WebIDL::ExceptionOr<JS::NonnullGCPtr<Event>> Event::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, EventInit const& event_init)
{
return create(realm, event_name, event_init);
}