1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:57:35 +00:00

LibWeb: Make factory method of CSS::MediaQueryListEvent fallible

This commit is contained in:
Kenneth Myhra 2023-02-14 20:05:30 +01:00 committed by Linus Groh
parent 64e4d3fd94
commit 1e24126004
2 changed files with 3 additions and 3 deletions

View file

@ -10,9 +10,9 @@
namespace Web::CSS { namespace Web::CSS {
MediaQueryListEvent* MediaQueryListEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init) WebIDL::ExceptionOr<JS::NonnullGCPtr<MediaQueryListEvent>> MediaQueryListEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init)
{ {
return realm.heap().allocate<MediaQueryListEvent>(realm, realm, event_name, event_init).release_allocated_value_but_fixme_should_propagate_errors(); return MUST_OR_THROW_OOM(realm.heap().allocate<MediaQueryListEvent>(realm, realm, event_name, event_init));
} }
MediaQueryListEvent::MediaQueryListEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init) MediaQueryListEvent::MediaQueryListEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init)

View file

@ -19,7 +19,7 @@ class MediaQueryListEvent final : public DOM::Event {
WEB_PLATFORM_OBJECT(MediaQueryListEvent, DOM::Event); WEB_PLATFORM_OBJECT(MediaQueryListEvent, DOM::Event);
public: public:
static MediaQueryListEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init = {}); static WebIDL::ExceptionOr<JS::NonnullGCPtr<MediaQueryListEvent>> construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init = {});
virtual ~MediaQueryListEvent() override; virtual ~MediaQueryListEvent() override;