1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:37:36 +00:00

LibWeb: Make factory methods of UIEvents::UIEvent fallible

This affects calls to FocusEvent::create() since FocusEvent does not
implement its own create() method.
This commit is contained in:
Kenneth Myhra 2023-02-19 10:38:20 +01:00 committed by Andreas Kling
parent a401cff4e2
commit 587cf355ed
4 changed files with 12 additions and 12 deletions

View file

@ -9,14 +9,14 @@
namespace Web::UIEvents {
UIEvent* UIEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name)
WebIDL::ExceptionOr<JS::NonnullGCPtr<UIEvent>> UIEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name)
{
return realm.heap().allocate<UIEvent>(realm, realm, event_name).release_allocated_value_but_fixme_should_propagate_errors();
return MUST_OR_THROW_OOM(realm.heap().allocate<UIEvent>(realm, realm, event_name));
}
UIEvent* UIEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, UIEventInit const& event_init)
WebIDL::ExceptionOr<JS::NonnullGCPtr<UIEvent>> UIEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, UIEventInit const& event_init)
{
return realm.heap().allocate<UIEvent>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors();
return MUST_OR_THROW_OOM(realm.heap().allocate<UIEvent>(realm, realm, event_name, event_init));
}
UIEvent::UIEvent(JS::Realm& realm, DeprecatedFlyString const& event_name)