diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-01-28 12:33:35 -0500 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-01-29 00:02:45 +0000 |
commit | 2692db869963ed10947b05f13eade5fcbd5951dc (patch) | |
tree | ef12b9e76ff4edb64571819643a92d8e6c33a2fe /Userland/Libraries/LibWeb/DOM/MutationObserver.cpp | |
parent | 1c1b902a6a0c1c7017fdc6d9748018317a554c9b (diff) | |
download | serenity-2692db869963ed10947b05f13eade5fcbd5951dc.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/MutationObserver.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/MutationObserver.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp b/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp index 7f01b98f76..fc2c9be5b0 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp +++ b/Userland/Libraries/LibWeb/DOM/MutationObserver.cpp @@ -31,10 +31,12 @@ MutationObserver::MutationObserver(JS::Realm& realm, JS::GCPtr<WebIDL::CallbackT MutationObserver::~MutationObserver() = default; -void MutationObserver::initialize(JS::Realm& realm) +JS::ThrowCompletionOr<void> MutationObserver::initialize(JS::Realm& realm) { - Base::initialize(realm); + MUST_OR_THROW_OOM(Base::initialize(realm)); set_prototype(&Bindings::ensure_web_prototype<Bindings::MutationObserverPrototype>(realm, "MutationObserver")); + + return {}; } void MutationObserver::visit_edges(Cell::Visitor& visitor) |