mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:37:45 +00:00
LibJS: Add a method to ThrowCompletionOr to drop allocation errors
This should solely be used to ignore completions from Heap::allocate in currently-infallible contexts. It's mostly meant to let us both ignore these errors and mark them with a FIXME in one go.
This commit is contained in:
parent
2692db8699
commit
2b5054c903
1 changed files with 6 additions and 0 deletions
|
@ -332,6 +332,12 @@ public:
|
||||||
[[nodiscard]] ValueType release_value() { return m_value.release_value(); }
|
[[nodiscard]] ValueType release_value() { return m_value.release_value(); }
|
||||||
Completion release_error() { return m_throw_completion.release_value(); }
|
Completion release_error() { return m_throw_completion.release_value(); }
|
||||||
|
|
||||||
|
ValueType release_allocated_value_but_fixme_should_propagate_errors()
|
||||||
|
{
|
||||||
|
VERIFY(!is_error());
|
||||||
|
return release_value();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Optional<Completion> m_throw_completion;
|
Optional<Completion> m_throw_completion;
|
||||||
Optional<ValueType> m_value;
|
Optional<ValueType> m_value;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue