mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
LibJS: Add spec comments to new_object_environment()
This commit is contained in:
parent
1cd46af7b0
commit
c6638f53c0
1 changed files with 6 additions and 0 deletions
|
@ -397,6 +397,12 @@ DeclarativeEnvironment* new_declarative_environment(Environment& environment)
|
|||
ObjectEnvironment* new_object_environment(Object& object, bool is_with_environment, Environment* environment)
|
||||
{
|
||||
auto& heap = object.heap();
|
||||
|
||||
// 1. Let env be a new Object Environment Record.
|
||||
// 2. Set env.[[BindingObject]] to O.
|
||||
// 3. Set env.[[IsWithEnvironment]] to W.
|
||||
// 4. Set env.[[OuterEnv]] to E.
|
||||
// 5. Return env.
|
||||
return heap.allocate_without_realm<ObjectEnvironment>(object, is_with_environment ? ObjectEnvironment::IsWithEnvironment::Yes : ObjectEnvironment::IsWithEnvironment::No, environment);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue