mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibJS: Follow the spec more closely when determining the this value
Co-authored-by: davidot <david.tuin@gmail.com>
This commit is contained in:
committed by
Andreas Kling
parent
a394aa5830
commit
c6e9c6d6ab
@@ -161,12 +161,8 @@ CallExpression::ThisAndCallee CallExpression::compute_this_and_callee(Interprete
|
||||
return { this_value, callee };
|
||||
}
|
||||
|
||||
if (interpreter.vm().in_strict_mode()) {
|
||||
// If we are in strict mode, |this| should never be bound to global object by default.
|
||||
return { js_undefined(), m_callee->execute(interpreter, global_object) };
|
||||
}
|
||||
|
||||
return { &global_object, m_callee->execute(interpreter, global_object) };
|
||||
// [[Call]] will handle that in non-strict mode the this value becomes the global object
|
||||
return { js_undefined(), m_callee->execute(interpreter, global_object) };
|
||||
}
|
||||
|
||||
// 13.3.8.1 Runtime Semantics: ArgumentListEvaluation, https://tc39.es/ecma262/#sec-runtime-semantics-argumentlistevaluation
|
||||
|
||||
Reference in New Issue
Block a user