mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-25 19:02:07 -05:00
LibJS: Add Completion::is_abrupt()
This is commonly used in the spec.
This commit is contained in:
parent
c58d51ce40
commit
7fc2807929
1 changed files with 3 additions and 0 deletions
|
@ -78,6 +78,9 @@ public:
|
|||
[[nodiscard]] bool has_target() const { return m_target.has_value(); }
|
||||
[[nodiscard]] FlyString const& target() const { return *m_target; }
|
||||
|
||||
// "abrupt completion refers to any completion with a [[Type]] value other than normal"
|
||||
[[nodiscard]] bool is_abrupt() const { return m_type != Type::Normal; }
|
||||
|
||||
// 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(); }
|
||||
|
|
Loading…
Add table
Reference in a new issue