mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 08:48:57 +00:00
LibJS: Add Completion::is_abrupt()
This is commonly used in the spec.
This commit is contained in:
parent
c58d51ce40
commit
7fc2807929
Notes:
sideshowbarker
2024-07-18 02:53:30 +09:00
Author: https://github.com/linusg
Commit: 7fc2807929
Pull-request: https://github.com/SerenityOS/serenity/pull/10402
Reviewed-by: https://github.com/awesomekling ✅
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
Add a link
Reference in a new issue