mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +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:
parent
08d2ea3fac
commit
b650d11dd3
10 changed files with 14 additions and 14 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue