mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:48:12 +00:00
LibWeb: Use TRY in DOMMatrix and DOMPointReadOnly
This commit is contained in:
parent
8e7d3a6acc
commit
7e9ea964a8
2 changed files with 3 additions and 12 deletions
|
@ -258,10 +258,7 @@ void DOMMatrix::set_f(double value)
|
|||
WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMMatrix>> DOMMatrix::multiply_self(DOMMatrixInit other)
|
||||
{
|
||||
// 1. Let otherObject be the result of invoking create a DOMMatrix from the dictionary other.
|
||||
auto maybe_other_object = DOMMatrix::create_from_dom_matrix_2d_init(realm(), other);
|
||||
if (maybe_other_object.is_exception())
|
||||
return maybe_other_object.exception();
|
||||
auto other_object = maybe_other_object.release_value();
|
||||
auto other_object = TRY(DOMMatrix::create_from_dom_matrix_2d_init(realm(), other));
|
||||
|
||||
// 2. The otherObject matrix gets post-multiplied to the current matrix.
|
||||
m_matrix = m_matrix * other_object->m_matrix;
|
||||
|
@ -278,10 +275,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMMatrix>> DOMMatrix::multiply_self(DOMMat
|
|||
WebIDL::ExceptionOr<JS::NonnullGCPtr<DOMMatrix>> DOMMatrix::pre_multiply_self(DOMMatrixInit other)
|
||||
{
|
||||
// 1. Let otherObject be the result of invoking create a DOMMatrix from the dictionary other.
|
||||
auto maybe_other_object = DOMMatrix::create_from_dom_matrix_2d_init(realm(), other);
|
||||
if (maybe_other_object.is_exception())
|
||||
return maybe_other_object.exception();
|
||||
auto other_object = maybe_other_object.release_value();
|
||||
auto other_object = TRY(DOMMatrix::create_from_dom_matrix_2d_init(realm(), other));
|
||||
|
||||
// 2. The otherObject matrix gets pre-multiplied to the current matrix.
|
||||
m_matrix = other_object->m_matrix * m_matrix;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue