mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:47:35 +00: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]] bool has_target() const { return m_target.has_value(); }
|
||||||
[[nodiscard]] FlyString const& target() const { return *m_target; }
|
[[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.
|
// These are for compatibility with the TRY() macro in AK.
|
||||||
[[nodiscard]] bool is_error() const { return m_type == Type::Throw; }
|
[[nodiscard]] bool is_error() const { return m_type == Type::Throw; }
|
||||||
[[nodiscard]] Value release_value() { return m_value.release_value(); }
|
[[nodiscard]] Value release_value() { return m_value.release_value(); }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue