mirror of
https://github.com/RGBCube/serenity
synced 2025-07-17 08:27:35 +00:00
LibWeb: Make factory method of XHR::XMLHttpRequest fallible
This commit is contained in:
parent
719839b882
commit
f28b8431bf
2 changed files with 3 additions and 3 deletions
|
@ -41,11 +41,11 @@
|
||||||
|
|
||||||
namespace Web::XHR {
|
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& window = verify_cast<HTML::Window>(realm.global_object());
|
||||||
auto author_request_headers = Fetch::Infrastructure::HeaderList::create(realm.vm());
|
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)
|
XMLHttpRequest::XMLHttpRequest(HTML::Window& window, Fetch::Infrastructure::HeaderList& author_request_headers)
|
||||||
|
|
|
@ -38,7 +38,7 @@ public:
|
||||||
Done = 4,
|
Done = 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
static JS::NonnullGCPtr<XMLHttpRequest> construct_impl(JS::Realm&);
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<XMLHttpRequest>> construct_impl(JS::Realm&);
|
||||||
|
|
||||||
virtual ~XMLHttpRequest() override;
|
virtual ~XMLHttpRequest() override;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue