diff --git a/Userland/Libraries/LibJS/Parser.cpp b/Userland/Libraries/LibJS/Parser.cpp index 8e850d49b1..d51480e277 100644 --- a/Userland/Libraries/LibJS/Parser.cpp +++ b/Userland/Libraries/LibJS/Parser.cpp @@ -2230,19 +2230,8 @@ NonnullRefPtr Parser::parse_expression(int min_precedence, Ass if (is(*expression) && m_state.current_scope_pusher) { auto& callee = static_ptr_cast(expression)->callee(); - if (is(callee)) { - auto& identifier_instance = static_cast(callee); - if (identifier_instance.string() == "eval"sv) { - bool has_not_been_declared_as_variable = true; - for (auto scope = m_state.current_scope_pusher; scope; scope = scope->parent_scope()) { - if (scope->has_declaration(identifier_instance.string())) { - has_not_been_declared_as_variable = false; - break; - } - } - if (has_not_been_declared_as_variable) - m_state.current_scope_pusher->set_contains_direct_call_to_eval(); - } + if (is(callee) && static_cast(callee).string() == "eval"sv) { + m_state.current_scope_pusher->set_contains_direct_call_to_eval(); } }