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

LibJS: Add make_handle({Nonnull,}GCPtr<T>) overloads

This commit is contained in:
Linus Groh 2022-12-14 18:37:37 +00:00 committed by Tim Flynn
parent 029db614e3
commit 2a66fc6cae
5 changed files with 18 additions and 4 deletions

View file

@ -107,7 +107,7 @@ JS::NonnullGCPtr<JS::Promise> fetch_impl(JS::VM& vm, RequestInfo const& input, R
// 4. Set responseObject to the result of creating a Response object, given response, "immutable", and
// relevantRealm.
auto response_object = Response::create(relevant_realm, response, Headers::Guard::Immutable);
response_object_handle = JS::make_handle(response_object.ptr());
response_object_handle = JS::make_handle(response_object);
// 5. Resolve p with responseObject.
WebIDL::resolve_promise(vm, promise_capability, response_object);

View file

@ -323,7 +323,7 @@ Vector<JS::Handle<DOM::Document>> EventLoop::documents_in_this_event_loop() cons
Vector<JS::Handle<DOM::Document>> documents;
for (auto& document : m_documents) {
VERIFY(document);
documents.append(JS::make_handle(*document.ptr()));
documents.append(JS::make_handle(*document));
}
return documents;
}

View file

@ -1174,7 +1174,7 @@ Create:
auto new_element = insert_html_element(HTMLToken::make_start_tag(entry->element->local_name()));
// 9. Replace the entry for entry in the list with an entry for new element.
m_list_of_active_formatting_elements.entries().at(index).element = JS::make_handle(new_element.ptr());
m_list_of_active_formatting_elements.entries().at(index).element = JS::make_handle(new_element);
// 10. If the entry for new element in the list of active formatting elements is not the last entry in the list, return to the step labeled advance.
if (index != m_list_of_active_formatting_elements.entries().size() - 1)