summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Completion.h
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Completion.h')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Completion.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Completion.h b/Userland/Libraries/LibJS/Runtime/Completion.h
index 3a9b62b4b7..252d5a3be5 100644
--- a/Userland/Libraries/LibJS/Runtime/Completion.h
+++ b/Userland/Libraries/LibJS/Runtime/Completion.h
@@ -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(); }