diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp index a6ac6ae150..02e7a697e7 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp @@ -41,11 +41,11 @@ namespace Web::XHR { -JS::NonnullGCPtr XMLHttpRequest::construct_impl(JS::Realm& realm) +WebIDL::ExceptionOr> XMLHttpRequest::construct_impl(JS::Realm& realm) { auto& window = verify_cast(realm.global_object()); auto author_request_headers = Fetch::Infrastructure::HeaderList::create(realm.vm()); - return realm.heap().allocate(realm, window, *author_request_headers).release_allocated_value_but_fixme_should_propagate_errors(); + return MUST_OR_THROW_OOM(realm.heap().allocate(realm, window, *author_request_headers)); } XMLHttpRequest::XMLHttpRequest(HTML::Window& window, Fetch::Infrastructure::HeaderList& author_request_headers) diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h index 396c2cfd59..817170ae5e 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h @@ -38,7 +38,7 @@ public: Done = 4, }; - static JS::NonnullGCPtr construct_impl(JS::Realm&); + static WebIDL::ExceptionOr> construct_impl(JS::Realm&); virtual ~XMLHttpRequest() override;