diff --git a/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp b/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp index 915c74ba83..5d587e246f 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp +++ b/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp @@ -11,9 +11,9 @@ namespace Web::DOM { -JS::NonnullGCPtr MutationObserver::construct_impl(JS::Realm& realm, JS::GCPtr callback) +WebIDL::ExceptionOr> MutationObserver::construct_impl(JS::Realm& realm, JS::GCPtr callback) { - return realm.heap().allocate(realm, realm, callback).release_allocated_value_but_fixme_should_propagate_errors(); + return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm, callback)); } // https://dom.spec.whatwg.org/#dom-mutationobserver-mutationobserver diff --git a/Userland/Libraries/LibWeb/DOM/MutationObserver.h b/Userland/Libraries/LibWeb/DOM/MutationObserver.h index f12d1b4c48..9a61f6750d 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationObserver.h +++ b/Userland/Libraries/LibWeb/DOM/MutationObserver.h @@ -32,7 +32,7 @@ class MutationObserver final : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(MutationObserver, Bindings::PlatformObject); public: - static JS::NonnullGCPtr construct_impl(JS::Realm&, JS::GCPtr); + static WebIDL::ExceptionOr> construct_impl(JS::Realm&, JS::GCPtr); virtual ~MutationObserver() override; WebIDL::ExceptionOr observe(Node& target, MutationObserverInit options = {});