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.
This commit is contained in:
Ali Mohammad Pur 2021-09-14 16:54:00 +04:30 committed by Linus Groh
parent f7a68ae998
commit 4f7e14e0aa
Notes: sideshowbarker 2024-07-18 03:58:20 +09:00

View File

@ -251,7 +251,7 @@ Value CallExpression::execute(Interpreter& interpreter, GlobalObject& global_obj
auto& function = callee.as_function();
if (is<Identifier>(*m_callee) && static_cast<Identifier const&>(*m_callee).string() == vm.names.eval.as_string() && &function == global_object.eval_function()) {
if (&function == global_object.eval_function() && is<Identifier>(*m_callee) && static_cast<Identifier const&>(*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);
}