From 8d940d57a47666314fe5da17b3b9f0fc6cfcbc6f Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sat, 15 Jul 2023 20:46:13 +0200 Subject: [PATCH] LibJS: Delete for_each_lexical_function_declaration_in_reverse_order() This function became unused after the only place where it was used was refactored in 7af7e90e3f148954b77e07d05bf679fab9ab3bba --- Userland/Libraries/LibJS/AST.cpp | 10 ---------- Userland/Libraries/LibJS/AST.h | 1 - 2 files changed, 11 deletions(-) diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index 8145727bb9..287b0fb1ac 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -4474,16 +4474,6 @@ ThrowCompletionOr ScopeNode::for_each_var_function_declaration_in_reverse_ return {}; } -ThrowCompletionOr ScopeNode::for_each_lexical_function_declaration_in_reverse_order(ThrowCompletionOrVoidCallback&& callback) const -{ - for (ssize_t i = m_lexical_declarations.size() - 1; i >= 0; i--) { - auto& declaration = m_lexical_declarations[i]; - if (is(declaration)) - TRY(callback(static_cast(*declaration))); - } - return {}; -} - ThrowCompletionOr ScopeNode::for_each_var_scoped_variable_declaration(ThrowCompletionOrVoidCallback&& callback) const { for (auto& declaration : m_var_declarations) { diff --git a/Userland/Libraries/LibJS/AST.h b/Userland/Libraries/LibJS/AST.h index 74154e1dbe..8c8d9f36d7 100644 --- a/Userland/Libraries/LibJS/AST.h +++ b/Userland/Libraries/LibJS/AST.h @@ -314,7 +314,6 @@ public: ThrowCompletionOr for_each_var_declared_identifier(ThrowCompletionOrVoidCallback&& callback) const; ThrowCompletionOr for_each_var_function_declaration_in_reverse_order(ThrowCompletionOrVoidCallback&& callback) const; - ThrowCompletionOr for_each_lexical_function_declaration_in_reverse_order(ThrowCompletionOrVoidCallback&& callback) const; ThrowCompletionOr for_each_var_scoped_variable_declaration(ThrowCompletionOrVoidCallback&& callback) const; void block_declaration_instantiation(VM&, Environment*) const;