1
Fork 0
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:
Andreas Kling 2021-06-25 20:14:17 +02:00
parent 08d2ea3fac
commit b650d11dd3
10 changed files with 14 additions and 14 deletions

View file

@ -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;