mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:37:35 +00:00
LibJS: Bring function environment records closer to the spec
This patch adds FunctionEnvironmentRecord as a subclass of the existing DeclarativeEnvironmentRecord. Things that are specific to function environment records move into there, simplifying the base. Most of the abstract operations related to function environment records are rewritten to match the spec exactly. I also had to implement GetThisEnvironment() and GetSuperConstructor() to keep tests working after the changes, so that's nice as well. :^)
This commit is contained in:
parent
6ed6434bab
commit
aabd82d508
28 changed files with 228 additions and 159 deletions
|
@ -15,6 +15,8 @@ namespace JS {
|
|||
|
||||
DeclarativeEnvironmentRecord* new_declarative_environment(EnvironmentRecord&);
|
||||
ObjectEnvironmentRecord* new_object_environment(Object&, bool is_with_environment, EnvironmentRecord*);
|
||||
EnvironmentRecord& get_this_environment(VM&);
|
||||
Object* get_super_constructor(VM&);
|
||||
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