diff options
author | Andreas Kling <kling@serenityos.org> | 2021-06-22 13:30:48 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-22 18:44:53 +0200 |
commit | aabd82d50886c14741500c03fc58fb3863b45ddb (patch) | |
tree | 21359e759fab78f2d7c6c3bf4d1f3fa106a6fc4b /Userland/Libraries/LibJS/Runtime/AbstractOperations.h | |
parent | 6ed6434bab2b136a64a7e8374dbc58b467017016 (diff) | |
download | serenity-aabd82d50886c14741500c03fc58fb3863b45ddb.zip |
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. :^)
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/AbstractOperations.h')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/AbstractOperations.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/AbstractOperations.h index 0b4a7b22cd..737ebdf368 100644 --- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.h +++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.h @@ -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&); |