1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +00:00

LibWeb: Make factory method of XHR::XMLHttpRequest fallible

This commit is contained in:
Kenneth Myhra 2023-02-14 20:34:37 +01:00 committed by Linus Groh
parent 719839b882
commit f28b8431bf
2 changed files with 3 additions and 3 deletions

View file

@ -41,11 +41,11 @@
namespace Web::XHR {
JS::NonnullGCPtr<XMLHttpRequest> XMLHttpRequest::construct_impl(JS::Realm& realm)
WebIDL::ExceptionOr<JS::NonnullGCPtr<XMLHttpRequest>> XMLHttpRequest::construct_impl(JS::Realm& realm)
{
auto& window = verify_cast<HTML::Window>(realm.global_object());
auto author_request_headers = Fetch::Infrastructure::HeaderList::create(realm.vm());
return realm.heap().allocate<XMLHttpRequest>(realm, window, *author_request_headers).release_allocated_value_but_fixme_should_propagate_errors();
return MUST_OR_THROW_OOM(realm.heap().allocate<XMLHttpRequest>(realm, window, *author_request_headers));
}
XMLHttpRequest::XMLHttpRequest(HTML::Window& window, Fetch::Infrastructure::HeaderList& author_request_headers)