mirror of
https://github.com/RGBCube/serenity
synced 2025-07-17 09:17:35 +00:00
LibJS: Add spec comments to new_declarative_environment()
This commit is contained in:
parent
d51ab20aaa
commit
1cd46af7b0
1 changed files with 6 additions and 1 deletions
|
@ -385,7 +385,12 @@ ThrowCompletionOr<Object*> get_prototype_from_constructor(VM& vm, FunctionObject
|
||||||
// 9.1.2.2 NewDeclarativeEnvironment ( E ), https://tc39.es/ecma262/#sec-newdeclarativeenvironment
|
// 9.1.2.2 NewDeclarativeEnvironment ( E ), https://tc39.es/ecma262/#sec-newdeclarativeenvironment
|
||||||
DeclarativeEnvironment* new_declarative_environment(Environment& environment)
|
DeclarativeEnvironment* new_declarative_environment(Environment& environment)
|
||||||
{
|
{
|
||||||
return environment.heap().allocate_without_realm<DeclarativeEnvironment>(&environment);
|
auto& heap = environment.heap();
|
||||||
|
|
||||||
|
// 1. Let env be a new Declarative Environment Record containing no bindings.
|
||||||
|
// 2. Set env.[[OuterEnv]] to E.
|
||||||
|
// 3. Return env.
|
||||||
|
return heap.allocate_without_realm<DeclarativeEnvironment>(&environment);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 9.1.2.3 NewObjectEnvironment ( O, W, E ), https://tc39.es/ecma262/#sec-newobjectenvironment
|
// 9.1.2.3 NewObjectEnvironment ( O, W, E ), https://tc39.es/ecma262/#sec-newobjectenvironment
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue