mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02:00
LibJS: Set the bound |this| value to the |this| value of the current
scope for arrow functions
This commit is contained in:
committed by
Andreas Kling
parent
c12125fa81
commit
45ccd9f8d9
Notes:
sideshowbarker
2024-07-19 05:58:26 +09:00
Author: https://github.com/jack-karamanian Commit: https://github.com/SerenityOS/serenity/commit/45ccd9f8d9d Pull-request: https://github.com/SerenityOS/serenity/pull/2454
@@ -53,7 +53,7 @@ ScriptFunction* ScriptFunction::create(GlobalObject& global_object, const FlyStr
|
||||
}
|
||||
|
||||
ScriptFunction::ScriptFunction(const FlyString& name, const Statement& body, Vector<FunctionNode::Parameter> parameters, i32 m_function_length, LexicalEnvironment* parent_environment, Object& prototype, bool is_arrow_function)
|
||||
: Function(prototype)
|
||||
: Function(prototype, is_arrow_function ? interpreter().this_value() : Value(), {})
|
||||
, m_name(name)
|
||||
, m_body(body)
|
||||
, m_parameters(move(parameters))
|
||||
|
||||
Reference in New Issue
Block a user