From 81492b3cee16f53afb5a721698ec0f6f61735428 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 5 Jan 2022 19:12:46 +0100 Subject: [PATCH] LibJS: Remove the now unused custom VM unwind mechanism Goodbye VM::m_unwind_until, you served us well :^) --- Userland/Libraries/LibJS/Runtime/VM.h | 34 --------------------------- 1 file changed, 34 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index 1741b71c5ed..74e3fac855f 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -30,15 +30,6 @@ namespace JS { class Identifier; struct BindingPattern; -enum class ScopeType { - None, - Function, - Block, - Try, - Breakable, - Continuable, -}; - class VM : public RefCounted { public: struct CustomData { @@ -169,29 +160,6 @@ public: u32 execution_generation() const { return m_execution_generation; } void finish_execution_generation() { ++m_execution_generation; } - void unwind(ScopeType type, FlyString label = {}) - { - m_unwind_until = type; - m_unwind_until_label = move(label); - } - void stop_unwind() - { - m_unwind_until = ScopeType::None; - m_unwind_until_label = {}; - } - bool should_unwind_until(ScopeType type, Vector const& labels) const - { - if (m_unwind_until_label.is_null()) - return m_unwind_until == type; - return m_unwind_until == type && any_of(labels.begin(), labels.end(), [&](FlyString const& label) { - return m_unwind_until_label == label; - }); - } - bool should_unwind() const { return m_unwind_until != ScopeType::None; } - - ScopeType unwind_until() const { return m_unwind_until; } - FlyString unwind_until_label() const { return m_unwind_until_label; } - ThrowCompletionOr resolve_binding(FlyString const&, Environment* = nullptr); ThrowCompletionOr get_identifier_reference(Environment*, FlyString, bool strict, size_t hops = 0); @@ -294,8 +262,6 @@ private: Vector> m_saved_execution_context_stacks; Value m_last_value; - ScopeType m_unwind_until { ScopeType::None }; - FlyString m_unwind_until_label; StackInfo m_stack_info;