diff --git a/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp b/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp index 325d91187a..c709f09472 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.cpp @@ -7,12 +7,13 @@ #include #include +#include namespace Web::Geometry { -JS::NonnullGCPtr DOMPointReadOnly::construct_impl(JS::Realm& realm, double x, double y, double z, double w) +WebIDL::ExceptionOr> DOMPointReadOnly::construct_impl(JS::Realm& realm, double x, double y, double z, double w) { - return realm.heap().allocate(realm, realm, x, y, z, w).release_allocated_value_but_fixme_should_propagate_errors(); + return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm, x, y, z, w)); } DOMPointReadOnly::DOMPointReadOnly(JS::Realm& realm, double x, double y, double z, double w) @@ -25,7 +26,7 @@ DOMPointReadOnly::DOMPointReadOnly(JS::Realm& realm, double x, double y, double } // https://drafts.fxtf.org/geometry/#dom-dompointreadonly-frompoint -JS::NonnullGCPtr DOMPointReadOnly::from_point(JS::VM& vm, DOMPointInit const& other) +WebIDL::ExceptionOr> DOMPointReadOnly::from_point(JS::VM& vm, DOMPointInit const& other) { // The fromPoint(other) static method on DOMPointReadOnly must create a DOMPointReadOnly from the dictionary other. return construct_impl(*vm.current_realm(), other.x, other.y, other.z, other.w); diff --git a/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.h b/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.h index c52bc75bee..5412f9a51b 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.h +++ b/Userland/Libraries/LibWeb/Geometry/DOMPointReadOnly.h @@ -25,9 +25,9 @@ class DOMPointReadOnly : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(DOMPointReadOnly, Bindings::PlatformObject); public: - static JS::NonnullGCPtr construct_impl(JS::Realm&, double x = 0, double y = 0, double z = 0, double w = 1); + static WebIDL::ExceptionOr> construct_impl(JS::Realm&, double x = 0, double y = 0, double z = 0, double w = 1); - static JS::NonnullGCPtr from_point(JS::VM&, DOMPointInit const&); + static WebIDL::ExceptionOr> from_point(JS::VM&, DOMPointInit const&); virtual ~DOMPointReadOnly() override;