mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-21 02:08:12 +03:00
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:
parent
f7a68ae998
commit
4f7e14e0aa
Notes:
sideshowbarker
2024-07-18 03:58:20 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/4f7e14e0aa7 Pull-request: https://github.com/SerenityOS/serenity/pull/10026 Reviewed-by: https://github.com/davidot Reviewed-by: https://github.com/linusg ✅
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user