1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-08 06:47:34 +00:00

LibWeb: Make factory method of SVG::SVGLength fallible

This commit is contained in:
Kenneth Myhra 2023-02-15 20:25:50 +01:00 committed by Linus Groh
parent bfc8cbcf3b
commit 71316614b8
7 changed files with 45 additions and 45 deletions

View file

@ -30,17 +30,17 @@ JS::ThrowCompletionOr<void> SVGForeignObjectElement::initialize(JS::Realm& realm
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGForeignObjectElementPrototype>(realm, "SVGForeignObjectElement"));
// FIXME: These never actually get updated!
m_x = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() {
return SVGAnimatedLength::create(realm, SVGLength::create(realm, 0, 0), SVGLength::create(realm, 0, 0));
m_x = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() -> WebIDL::ExceptionOr<JS::NonnullGCPtr<SVGAnimatedLength>> {
return SVGAnimatedLength::create(realm, TRY(SVGLength::create(realm, 0, 0)), TRY(SVGLength::create(realm, 0, 0)));
}));
m_y = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() {
return SVGAnimatedLength::create(realm, SVGLength::create(realm, 0, 0), SVGLength::create(realm, 0, 0));
m_y = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() -> WebIDL::ExceptionOr<JS::NonnullGCPtr<SVGAnimatedLength>> {
return SVGAnimatedLength::create(realm, TRY(SVGLength::create(realm, 0, 0)), TRY(SVGLength::create(realm, 0, 0)));
}));
m_width = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() {
return SVGAnimatedLength::create(realm, SVGLength::create(realm, 0, 0), SVGLength::create(realm, 0, 0));
m_width = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() -> WebIDL::ExceptionOr<JS::NonnullGCPtr<SVGAnimatedLength>> {
return SVGAnimatedLength::create(realm, TRY(SVGLength::create(realm, 0, 0)), TRY(SVGLength::create(realm, 0, 0)));
}));
m_height = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() {
return SVGAnimatedLength::create(realm, SVGLength::create(realm, 0, 0), SVGLength::create(realm, 0, 0));
m_height = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() -> WebIDL::ExceptionOr<JS::NonnullGCPtr<SVGAnimatedLength>> {
return SVGAnimatedLength::create(realm, TRY(SVGLength::create(realm, 0, 0)), TRY(SVGLength::create(realm, 0, 0)));
}));
return {};