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

LibJS+Everywhere: Propagate Cell::initialize errors from Heap::allocate

Callers that are already in a fallible context will now TRY to allocate
cells. Callers in infallible contexts get a FIXME.
This commit is contained in:
Timothy Flynn 2023-01-28 13:39:44 -05:00 committed by Linus Groh
parent 109b190a19
commit b75b7f0c0d
178 changed files with 565 additions and 565 deletions

View file

@ -20,7 +20,7 @@ namespace Web::DOM {
JS::NonnullGCPtr<DOMImplementation> DOMImplementation::create(Document& document)
{
auto& realm = document.realm();
return realm.heap().allocate<DOMImplementation>(realm, document);
return realm.heap().allocate<DOMImplementation>(realm, document).release_allocated_value_but_fixme_should_propagate_errors();
}
DOMImplementation::DOMImplementation(Document& document)
@ -84,7 +84,7 @@ JS::NonnullGCPtr<Document> DOMImplementation::create_html_document(DeprecatedStr
html_document->set_content_type("text/html");
html_document->set_ready_for_post_load_tasks(true);
auto doctype = heap().allocate<DocumentType>(realm(), html_document);
auto doctype = heap().allocate<DocumentType>(realm(), html_document).release_allocated_value_but_fixme_should_propagate_errors();
doctype->set_name("html");
MUST(html_document->append_child(*doctype));
@ -98,7 +98,7 @@ JS::NonnullGCPtr<Document> DOMImplementation::create_html_document(DeprecatedStr
auto title_element = create_element(html_document, HTML::TagNames::title, Namespace::HTML);
MUST(head_element->append_child(title_element));
auto text_node = heap().allocate<Text>(realm(), html_document, title);
auto text_node = heap().allocate<Text>(realm(), html_document, title).release_allocated_value_but_fixme_should_propagate_errors();
MUST(title_element->append_child(*text_node));
}