mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibJS: FunctionEnvironment.[[FunctionObject]] is the *invoked* function
We were setting the wrong [[FunctionObject]] on the environment when going through ProxyObject and BoundFunction.
This commit is contained in:
@@ -425,7 +425,7 @@ Value VM::construct(Function& function, Function& new_target, Optional<MarkedVal
|
||||
callee_context.arguments = function.bound_arguments();
|
||||
if (arguments.has_value())
|
||||
callee_context.arguments.extend(arguments.value().values());
|
||||
auto* environment = function.create_environment_record();
|
||||
auto* environment = function.create_environment_record(function);
|
||||
callee_context.lexical_environment = environment;
|
||||
callee_context.variable_environment = environment;
|
||||
if (environment)
|
||||
@@ -529,7 +529,7 @@ Value VM::call_internal(Function& function, Value this_value, Optional<MarkedVal
|
||||
callee_context.arguments = function.bound_arguments();
|
||||
if (arguments.has_value())
|
||||
callee_context.arguments.extend(arguments.value().values());
|
||||
auto* environment = function.create_environment_record();
|
||||
auto* environment = function.create_environment_record(function);
|
||||
callee_context.lexical_environment = environment;
|
||||
callee_context.variable_environment = environment;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user