summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-06-22 13:30:48 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-22 18:44:53 +0200
commitaabd82d50886c14741500c03fc58fb3863b45ddb (patch)
tree21359e759fab78f2d7c6c3bf4d1f3fa106a6fc4b /Userland/Libraries/LibJS/Runtime/GlobalObject.cpp
parent6ed6434bab2b136a64a7e8374dbc58b467017016 (diff)
downloadserenity-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/GlobalObject.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/GlobalObject.cpp10
1 files changed, 0 insertions, 10 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp
index aada03b332..173d23d91d 100644
--- a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp
@@ -346,16 +346,6 @@ bool GlobalObject::delete_from_environment_record(FlyString const& name)
return delete_property(name);
}
-bool GlobalObject::has_this_binding() const
-{
- return true;
-}
-
-Value GlobalObject::get_this_binding(GlobalObject&) const
-{
- return Value(this);
-}
-
// 19.2.1 eval ( x ), https://tc39.es/ecma262/#sec-eval-x
JS_DEFINE_NATIVE_FUNCTION(GlobalObject::eval)
{