1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:58:12 +00:00

LibWeb: Make factory method of DOM::DOMTokenList fallible

This commit is contained in:
Kenneth Myhra 2023-02-14 21:34:28 +01:00 committed by Linus Groh
parent 1e03aa0ece
commit 251c063897
3 changed files with 4 additions and 4 deletions

View file

@ -52,10 +52,10 @@ inline void replace_in_ordered_set(Vector<DeprecatedString>& set, StringView ite
namespace Web::DOM {
DOMTokenList* DOMTokenList::create(Element const& associated_element, DeprecatedFlyString associated_attribute)
WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMTokenList>> DOMTokenList::create(Element const& associated_element, DeprecatedFlyString associated_attribute)
{
auto& realm = associated_element.realm();
return realm.heap().allocate<DOMTokenList>(realm, associated_element, move(associated_attribute)).release_allocated_value_but_fixme_should_propagate_errors();
return MUST_OR_THROW_OOM(realm.heap().allocate<DOMTokenList>(realm, associated_element, move(associated_attribute)));
}
// https://dom.spec.whatwg.org/#ref-for-domtokenlist%E2%91%A0%E2%91%A2