mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 07:57:46 +00:00
LibJS: Implement the NewObjectEnvironment() abstract operation
This commit is contained in:
parent
d8e9a176cd
commit
395bee07e0
3 changed files with 14 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
namespace JS {
|
||||
|
||||
DeclarativeEnvironmentRecord* new_declarative_environment(EnvironmentRecord&);
|
||||
ObjectEnvironmentRecord* new_object_environment(Object&, bool is_with_environment, EnvironmentRecord*);
|
||||
Value require_object_coercible(GlobalObject&, Value);
|
||||
Function* get_method(GlobalObject& global_object, Value, PropertyName const&);
|
||||
size_t length_of_array_like(GlobalObject&, Object const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue