mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:07:34 +00:00
LibJS: Don't assume non-empty [[Value]] in Completion TRY() helpers
This commit is contained in:
parent
032e6a2d28
commit
95acb1ce88
8 changed files with 10 additions and 9 deletions
|
@ -70,10 +70,11 @@ public:
|
|||
|
||||
// These are for compatibility with the TRY() macro in AK.
|
||||
[[nodiscard]] bool is_error() const { return m_type == Type::Throw; }
|
||||
[[nodiscard]] Value release_value() { return m_value.release_value(); }
|
||||
[[nodiscard]] Optional<Value> release_value() { return move(m_value); }
|
||||
Completion release_error()
|
||||
{
|
||||
VERIFY(is_error());
|
||||
VERIFY(m_value.has_value());
|
||||
return { m_type, release_value(), move(m_target) };
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue