summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-09-14 16:54:00 +0430
committerLinus Groh <mail@linusgroh.de>2021-09-14 20:03:27 +0100
commit4f7e14e0aa77508f5c63f88665d7d79153b68fd1 (patch)
tree84f8d824d34279a57e2cc11b88d386ff34edad7c
parentf7a68ae998e9a989cbc6e12ed95bc7cb8117632c (diff)
downloadserenity-4f7e14e0aa77508f5c63f88665d7d79153b68fd1.zip
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.
-rw-r--r--Userland/Libraries/LibJS/AST.cpp2
1 files changed, 1 insertions, 1 deletions
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<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);
}