mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
LibWeb: Make factory method of Geometry::DOMRectList fallible
This commit is contained in:
committed by
Andreas Kling
parent
4de5dc7a86
commit
9b190b9509
@@ -8,15 +8,16 @@
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Geometry/DOMRect.h>
|
||||
#include <LibWeb/Geometry/DOMRectList.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
namespace Web::Geometry {
|
||||
|
||||
JS::NonnullGCPtr<DOMRectList> DOMRectList::create(JS::Realm& realm, Vector<JS::Handle<DOMRect>> rect_handles)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMRectList>> DOMRectList::create(JS::Realm& realm, Vector<JS::Handle<DOMRect>> rect_handles)
|
||||
{
|
||||
Vector<JS::NonnullGCPtr<DOMRect>> rects;
|
||||
for (auto& rect : rect_handles)
|
||||
rects.append(*rect);
|
||||
return realm.heap().allocate<DOMRectList>(realm, realm, move(rects)).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<DOMRectList>(realm, realm, move(rects)));
|
||||
}
|
||||
|
||||
DOMRectList::DOMRectList(JS::Realm& realm, Vector<JS::NonnullGCPtr<DOMRect>> rects)
|
||||
|
||||
Reference in New Issue
Block a user