diff --git a/Userland/Libraries/LibWeb/DOM/Text.cpp b/Userland/Libraries/LibWeb/DOM/Text.cpp index 2ed109be55..b63442d039 100644 --- a/Userland/Libraries/LibWeb/DOM/Text.cpp +++ b/Userland/Libraries/LibWeb/DOM/Text.cpp @@ -39,11 +39,11 @@ void Text::visit_edges(Cell::Visitor& visitor) } // https://dom.spec.whatwg.org/#dom-text-text -JS::NonnullGCPtr Text::construct_impl(JS::Realm& realm, DeprecatedString const& data) +WebIDL::ExceptionOr> Text::construct_impl(JS::Realm& realm, DeprecatedString const& data) { // The new Text(data) constructor steps are to set this’s data to data and this’s node document to current global object’s associated Document. auto& window = verify_cast(HTML::current_global_object()); - return realm.heap().allocate(realm, window.associated_document(), data).release_allocated_value_but_fixme_should_propagate_errors(); + return MUST_OR_THROW_OOM(realm.heap().allocate(realm, window.associated_document(), data)); } void Text::set_owner_input_element(Badge, HTML::HTMLInputElement& input_element) diff --git a/Userland/Libraries/LibWeb/DOM/Text.h b/Userland/Libraries/LibWeb/DOM/Text.h index b0fe498bc7..8bb3326a14 100644 --- a/Userland/Libraries/LibWeb/DOM/Text.h +++ b/Userland/Libraries/LibWeb/DOM/Text.h @@ -18,7 +18,7 @@ class Text : public CharacterData { public: virtual ~Text() override = default; - static JS::NonnullGCPtr construct_impl(JS::Realm& realm, DeprecatedString const& data); + static WebIDL::ExceptionOr> construct_impl(JS::Realm& realm, DeprecatedString const& data); // ^Node virtual DeprecatedFlyString node_name() const override { return "#text"; }