1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:17:35 +00:00

LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtr

This commit is contained in:
Linus Groh 2022-12-14 17:40:33 +00:00 committed by Tim Flynn
parent 2a66fc6cae
commit 22089436ed
161 changed files with 367 additions and 370 deletions

View file

@ -77,7 +77,7 @@ JS::NonnullGCPtr<Request> Request::create(JS::Realm& realm, JS::NonnullGCPtr<Inf
{
// 1. Let requestObject be a new Request object with realm.
// 2. Set requestObjects request to request.
auto* request_object = realm.heap().allocate<Request>(realm, realm, request);
auto request_object = realm.heap().allocate<Request>(realm, realm, request);
// 3. Set requestObjects headers to a new Headers object with realm, whose headers list is requests headers list and guard is guard.
request_object->m_headers = realm.heap().allocate<Headers>(realm, realm, request->header_list());
@ -87,7 +87,7 @@ JS::NonnullGCPtr<Request> Request::create(JS::Realm& realm, JS::NonnullGCPtr<Inf
request_object->m_signal = realm.heap().allocate<DOM::AbortSignal>(realm, realm);
// 5. Return requestObject.
return JS::NonnullGCPtr { *request_object };
return request_object;
}
// https://fetch.spec.whatwg.org/#dom-request
@ -96,7 +96,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Request>> Request::construct_impl(JS::Realm
auto& vm = realm.vm();
// Referred to as 'this' in the spec.
auto request_object = JS::NonnullGCPtr { *realm.heap().allocate<Request>(realm, realm, Infrastructure::Request::create(vm)) };
auto request_object = realm.heap().allocate<Request>(realm, realm, Infrastructure::Request::create(vm));
// 1. Let request be null.
JS::GCPtr<Infrastructure::Request> input_request;