1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 08:17:35 +00:00

LibJS: Implement the NewObjectEnvironment() abstract operation

This commit is contained in:
Andreas Kling 2021-06-22 01:14:27 +02:00
parent d8e9a176cd
commit 395bee07e0
3 changed files with 14 additions and 1 deletions

View file

@ -14,6 +14,7 @@
#include <LibJS/Runtime/Function.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/Object.h>
#include <LibJS/Runtime/ObjectEnvironmentRecord.h>
#include <LibJS/Runtime/PropertyName.h>
#include <LibJS/Runtime/ProxyObject.h>
@ -165,4 +166,14 @@ DeclarativeEnvironmentRecord* new_declarative_environment(EnvironmentRecord& env
return global_object.heap().allocate<DeclarativeEnvironmentRecord>(global_object, &environment_record);
}
// 9.1.2.3 NewObjectEnvironment ( O, W, E ), https://tc39.es/ecma262/#sec-newobjectenvironment
ObjectEnvironmentRecord* new_object_environment(Object& object, bool is_with_environment, EnvironmentRecord* environment_record)
{
auto& global_object = object.global_object();
if (!is_with_environment) {
TODO();
}
return global_object.heap().allocate<ObjectEnvironmentRecord>(global_object, object, environment_record);
}
}