mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 11:27:35 +00:00
LibWeb: Make factory method of Geometry::DOMRectReadOnly fallible
This commit is contained in:
parent
ec0049441c
commit
07db02cd2c
2 changed files with 4 additions and 3 deletions
|
@ -6,12 +6,13 @@
|
||||||
|
|
||||||
#include <LibWeb/Bindings/Intrinsics.h>
|
#include <LibWeb/Bindings/Intrinsics.h>
|
||||||
#include <LibWeb/Geometry/DOMRectReadOnly.h>
|
#include <LibWeb/Geometry/DOMRectReadOnly.h>
|
||||||
|
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||||
|
|
||||||
namespace Web::Geometry {
|
namespace Web::Geometry {
|
||||||
|
|
||||||
JS::NonnullGCPtr<DOMRectReadOnly> DOMRectReadOnly::construct_impl(JS::Realm& realm, double x, double y, double width, double height)
|
WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMRectReadOnly>> DOMRectReadOnly::construct_impl(JS::Realm& realm, double x, double y, double width, double height)
|
||||||
{
|
{
|
||||||
return realm.heap().allocate<DOMRectReadOnly>(realm, realm, x, y, width, height).release_allocated_value_but_fixme_should_propagate_errors();
|
return MUST_OR_THROW_OOM(realm.heap().allocate<DOMRectReadOnly>(realm, realm, x, y, width, height));
|
||||||
}
|
}
|
||||||
|
|
||||||
DOMRectReadOnly::DOMRectReadOnly(JS::Realm& realm, double x, double y, double width, double height)
|
DOMRectReadOnly::DOMRectReadOnly(JS::Realm& realm, double x, double y, double width, double height)
|
||||||
|
|
|
@ -17,7 +17,7 @@ class DOMRectReadOnly : public Bindings::PlatformObject {
|
||||||
WEB_PLATFORM_OBJECT(DOMRectReadOnly, Bindings::PlatformObject);
|
WEB_PLATFORM_OBJECT(DOMRectReadOnly, Bindings::PlatformObject);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static JS::NonnullGCPtr<DOMRectReadOnly> construct_impl(JS::Realm&, double x = 0, double y = 0, double width = 0, double height = 0);
|
static WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMRectReadOnly>> construct_impl(JS::Realm&, double x = 0, double y = 0, double width = 0, double height = 0);
|
||||||
|
|
||||||
virtual ~DOMRectReadOnly() override;
|
virtual ~DOMRectReadOnly() override;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue