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

LibWeb: Make factory method of DOM::NamedNodeMap fallible

This commit is contained in:
Kenneth Myhra 2023-02-14 23:04:29 +01:00 committed by Linus Groh
parent ce18dfc417
commit e3e281addd
3 changed files with 7 additions and 4 deletions

View file

@ -13,10 +13,10 @@
namespace Web::DOM {
JS::NonnullGCPtr<NamedNodeMap> NamedNodeMap::create(Element& element)
WebIDL::ExceptionOr<JS::NonnullGCPtr<NamedNodeMap>> NamedNodeMap::create(Element& element)
{
auto& realm = element.realm();
return realm.heap().allocate<NamedNodeMap>(realm, element).release_allocated_value_but_fixme_should_propagate_errors();
return MUST_OR_THROW_OOM(realm.heap().allocate<NamedNodeMap>(realm, element));
}
NamedNodeMap::NamedNodeMap(Element& element)