1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:57:43 +00:00

LibJS: Make Heap::allocate<T>() infallible

Stop worrying about tiny OOMs. Work towards #20449.

While going through these, I also changed the function signature in many
places where returning ThrowCompletionOr<T> is no longer necessary.
This commit is contained in:
Andreas Kling 2023-08-13 13:05:26 +02:00
parent 980e7164fe
commit 72c9f56c66
337 changed files with 1229 additions and 1251 deletions

View file

@ -164,9 +164,9 @@ JS::NonnullGCPtr<SVGAnimatedLength> SVGRectElement::x() const
{
// FIXME: Populate the unit type when it is parsed (0 here is "unknown").
// FIXME: Create a proper animated value when animations are supported.
auto base_length = SVGLength::create(realm(), 0, m_x.value_or(0)).release_value_but_fixme_should_propagate_errors();
auto anim_length = SVGLength::create(realm(), 0, m_x.value_or(0)).release_value_but_fixme_should_propagate_errors();
return SVGAnimatedLength::create(realm(), move(base_length), move(anim_length)).release_value_but_fixme_should_propagate_errors();
auto base_length = SVGLength::create(realm(), 0, m_x.value_or(0));
auto anim_length = SVGLength::create(realm(), 0, m_x.value_or(0));
return SVGAnimatedLength::create(realm(), move(base_length), move(anim_length));
}
// https://www.w3.org/TR/SVG11/shapes.html#RectElementYAttribute
@ -174,9 +174,9 @@ JS::NonnullGCPtr<SVGAnimatedLength> SVGRectElement::y() const
{
// FIXME: Populate the unit type when it is parsed (0 here is "unknown").
// FIXME: Create a proper animated value when animations are supported.
auto base_length = SVGLength::create(realm(), 0, m_y.value_or(0)).release_value_but_fixme_should_propagate_errors();
auto anim_length = SVGLength::create(realm(), 0, m_y.value_or(0)).release_value_but_fixme_should_propagate_errors();
return SVGAnimatedLength::create(realm(), move(base_length), move(anim_length)).release_value_but_fixme_should_propagate_errors();
auto base_length = SVGLength::create(realm(), 0, m_y.value_or(0));
auto anim_length = SVGLength::create(realm(), 0, m_y.value_or(0));
return SVGAnimatedLength::create(realm(), move(base_length), move(anim_length));
}
// https://www.w3.org/TR/SVG11/shapes.html#RectElementWidthAttribute
@ -184,9 +184,9 @@ JS::NonnullGCPtr<SVGAnimatedLength> SVGRectElement::width() const
{
// FIXME: Populate the unit type when it is parsed (0 here is "unknown").
// FIXME: Create a proper animated value when animations are supported.
auto base_length = SVGLength::create(realm(), 0, m_width.value_or(0)).release_value_but_fixme_should_propagate_errors();
auto anim_length = SVGLength::create(realm(), 0, m_width.value_or(0)).release_value_but_fixme_should_propagate_errors();
return SVGAnimatedLength::create(realm(), move(base_length), move(anim_length)).release_value_but_fixme_should_propagate_errors();
auto base_length = SVGLength::create(realm(), 0, m_width.value_or(0));
auto anim_length = SVGLength::create(realm(), 0, m_width.value_or(0));
return SVGAnimatedLength::create(realm(), move(base_length), move(anim_length));
}
// https://www.w3.org/TR/SVG11/shapes.html#RectElementHeightAttribute
@ -194,9 +194,9 @@ JS::NonnullGCPtr<SVGAnimatedLength> SVGRectElement::height() const
{
// FIXME: Populate the unit type when it is parsed (0 here is "unknown").
// FIXME: Create a proper animated value when animations are supported.
auto base_length = SVGLength::create(realm(), 0, m_height.value_or(0)).release_value_but_fixme_should_propagate_errors();
auto anim_length = SVGLength::create(realm(), 0, m_height.value_or(0)).release_value_but_fixme_should_propagate_errors();
return SVGAnimatedLength::create(realm(), move(base_length), move(anim_length)).release_value_but_fixme_should_propagate_errors();
auto base_length = SVGLength::create(realm(), 0, m_height.value_or(0));
auto anim_length = SVGLength::create(realm(), 0, m_height.value_or(0));
return SVGAnimatedLength::create(realm(), move(base_length), move(anim_length));
}
// https://www.w3.org/TR/SVG11/shapes.html#RectElementRXAttribute
@ -204,9 +204,9 @@ JS::NonnullGCPtr<SVGAnimatedLength> SVGRectElement::rx() const
{
// FIXME: Populate the unit type when it is parsed (0 here is "unknown").
// FIXME: Create a proper animated value when animations are supported.
auto base_length = SVGLength::create(realm(), 0, m_radius_x.value_or(0)).release_value_but_fixme_should_propagate_errors();
auto anim_length = SVGLength::create(realm(), 0, m_radius_x.value_or(0)).release_value_but_fixme_should_propagate_errors();
return SVGAnimatedLength::create(realm(), move(base_length), move(anim_length)).release_value_but_fixme_should_propagate_errors();
auto base_length = SVGLength::create(realm(), 0, m_radius_x.value_or(0));
auto anim_length = SVGLength::create(realm(), 0, m_radius_x.value_or(0));
return SVGAnimatedLength::create(realm(), move(base_length), move(anim_length));
}
// https://www.w3.org/TR/SVG11/shapes.html#RectElementRYAttribute
@ -214,9 +214,9 @@ JS::NonnullGCPtr<SVGAnimatedLength> SVGRectElement::ry() const
{
// FIXME: Populate the unit type when it is parsed (0 here is "unknown").
// FIXME: Create a proper animated value when animations are supported.
auto base_length = SVGLength::create(realm(), 0, m_radius_y.value_or(0)).release_value_but_fixme_should_propagate_errors();
auto anim_length = SVGLength::create(realm(), 0, m_radius_y.value_or(0)).release_value_but_fixme_should_propagate_errors();
return SVGAnimatedLength::create(realm(), move(base_length), move(anim_length)).release_value_but_fixme_should_propagate_errors();
auto base_length = SVGLength::create(realm(), 0, m_radius_y.value_or(0));
auto anim_length = SVGLength::create(realm(), 0, m_radius_y.value_or(0));
return SVGAnimatedLength::create(realm(), move(base_length), move(anim_length));
}
}