1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:14:58 +00:00

LibJS: Add and fix some spec comments in AbstractOperations

This commit is contained in:
davidot 2021-12-30 14:14:05 +01:00 committed by Linus Groh
parent d72022ba04
commit 9d3623f0e8

View file

@ -199,7 +199,7 @@ ThrowCompletionOr<Realm*> get_function_realm(GlobalObject& global_object, Functi
return vm.current_realm();
}
// 8.5.2.1 InitializeBoundName ( name, value, environment ), 8.5.2.1 InitializeBoundName ( name, value, environment )
// 8.5.2.1 InitializeBoundName ( name, value, environment ), https://tc39.es/ecma262/#sec-initializeboundname
ThrowCompletionOr<void> initialize_bound_name(GlobalObject& global_object, FlyString const& name, Value value, Environment* environment)
{
auto& vm = global_object.vm();
@ -445,8 +445,11 @@ FunctionEnvironment* new_function_environment(ECMAScriptFunctionObject& function
return env;
}
// 9.2.1.1 NewPrivateEnvironment ( outerPrivEnv ), https://tc39.es/ecma262/#sec-newprivateenvironment
PrivateEnvironment* new_private_environment(VM& vm, PrivateEnvironment* outer)
{
// 1. Let names be a new empty List.
// 2. Return the PrivateEnvironment Record { [[OuterPrivateEnvironment]]: outerPrivEnv, [[Names]]: names }.
return vm.heap().allocate<PrivateEnvironment>(vm.current_realm()->global_object(), outer);
}