mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 01:37:39 +03:00
LibWeb: Make factory method of HTML::Path2D fallible
This commit is contained in:
parent
2b391ea622
commit
86b7f148b9
Notes:
sideshowbarker
2024-07-17 10:39:39 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/86b7f148b9 Pull-request: https://github.com/SerenityOS/serenity/pull/17491 Reviewed-by: https://github.com/linusg ✅
@ -12,9 +12,9 @@
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
JS::NonnullGCPtr<Path2D> Path2D::construct_impl(JS::Realm& realm, Optional<Variant<JS::Handle<Path2D>, DeprecatedString>> const& path)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Path2D>> Path2D::construct_impl(JS::Realm& realm, Optional<Variant<JS::Handle<Path2D>, DeprecatedString>> const& path)
|
||||
{
|
||||
return realm.heap().allocate<Path2D>(realm, realm, path).release_allocated_value_but_fixme_should_propagate_errors();
|
||||
return MUST_OR_THROW_OOM(realm.heap().allocate<Path2D>(realm, realm, path));
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/canvas.html#dom-path2d
|
||||
|
@ -21,7 +21,7 @@ class Path2D final
|
||||
WEB_PLATFORM_OBJECT(Path2D, Bindings::PlatformObject);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<Path2D> construct_impl(JS::Realm&, Optional<Variant<JS::Handle<Path2D>, DeprecatedString>> const& path);
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Path2D>> construct_impl(JS::Realm&, Optional<Variant<JS::Handle<Path2D>, DeprecatedString>> const& path);
|
||||
|
||||
virtual ~Path2D() override;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user