From 2692db869963ed10947b05f13eade5fcbd5951dc Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sat, 28 Jan 2023 12:33:35 -0500 Subject: LibJS+Everywhere: Allow Cell::initialize overrides to throw OOM errors Note that as of this commit, there aren't any such throwers, and the call site in Heap::allocate will drop exceptions on the floor. This commit only serves to change the declaration of the overrides, make sure they return an empty value, and to propagate OOM errors frm their base initialize invocations. --- Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp') diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp index 050187c916..3ebd7580b6 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp @@ -16,10 +16,12 @@ HTMLDivElement::HTMLDivElement(DOM::Document& document, DOM::QualifiedName quali HTMLDivElement::~HTMLDivElement() = default; -void HTMLDivElement::initialize(JS::Realm& realm) +JS::ThrowCompletionOr HTMLDivElement::initialize(JS::Realm& realm) { - Base::initialize(realm); + MUST_OR_THROW_OOM(Base::initialize(realm)); set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLDivElement")); + + return {}; } } -- cgit v1.2.3