From 4f7e14e0aa77508f5c63f88665d7d79153b68fd1 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Tue, 14 Sep 2021 16:54:00 +0430 Subject: [PATCH] LibJS: Reorder the global eval function call detection conditions a bit This just makes it clearer, since the actual check is off-screen, making the reader wonder what that check is for. --- Userland/Libraries/LibJS/AST.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index 1fb878c2be..7974961b78 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -251,7 +251,7 @@ Value CallExpression::execute(Interpreter& interpreter, GlobalObject& global_obj auto& function = callee.as_function(); - if (is(*m_callee) && static_cast(*m_callee).string() == vm.names.eval.as_string() && &function == global_object.eval_function()) { + if (&function == global_object.eval_function() && is(*m_callee) && static_cast(*m_callee).string() == vm.names.eval.as_string()) { auto script_value = arg_list.size() == 0 ? js_undefined() : arg_list[0]; return perform_eval(script_value, global_object, vm.in_strict_mode() ? CallerMode::Strict : CallerMode::NonStrict, EvalMode::Direct); }