mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-20 20:37:09 +00:00
LibJS: Add the Function.[[ThisMode]] field
This is not a behavioral change in itself, just prep work for future spec-compliance changes.
This commit is contained in:
@@ -61,6 +61,13 @@ ScriptFunction::ScriptFunction(GlobalObject& global_object, const FlyString& nam
|
||||
, m_is_strict(is_strict)
|
||||
, m_is_arrow_function(is_arrow_function)
|
||||
{
|
||||
// NOTE: This logic is from OrdinaryFunctionCreate, https://tc39.es/ecma262/#sec-ordinaryfunctioncreate
|
||||
if (m_is_arrow_function)
|
||||
set_this_mode(ThisMode::Lexical);
|
||||
else if (m_is_strict)
|
||||
set_this_mode(ThisMode::Strict);
|
||||
else
|
||||
set_this_mode(ThisMode::Global);
|
||||
}
|
||||
|
||||
void ScriptFunction::initialize(GlobalObject& global_object)
|
||||
|
||||
Reference in New Issue
Block a user