summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/WithScope.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-06-21 23:17:24 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-21 23:49:50 +0200
commit6c6dbcfc36e4603e40f403964207142664b96e46 (patch)
treee36afd55a79f2a9c01878368b3b04fce789a846b /Userland/Libraries/LibJS/Runtime/WithScope.cpp
parente9b4a0a8309098ea47a35cfac45be7fff5955140 (diff)
downloadserenity-6c6dbcfc36e4603e40f403964207142664b96e46.zip
LibJS: Rename Environment Records so they match the spec :^)
This patch makes the following name changes: - ScopeObject => EnvironmentRecord - LexicalEnvironment => DeclarativeEnvironmentRecord - WithScope => ObjectEnvironmentRecord
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/WithScope.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/WithScope.cpp52
1 files changed, 0 insertions, 52 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/WithScope.cpp b/Userland/Libraries/LibJS/Runtime/WithScope.cpp
deleted file mode 100644
index bacda90a96..0000000000
--- a/Userland/Libraries/LibJS/Runtime/WithScope.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
- *
- * SPDX-License-Identifier: BSD-2-Clause
- */
-
-#include <LibJS/AST.h>
-#include <LibJS/Runtime/WithScope.h>
-
-namespace JS {
-
-WithScope::WithScope(Object& object, ScopeObject* parent_scope)
- : ScopeObject(parent_scope)
- , m_object(object)
-{
-}
-
-void WithScope::visit_edges(Cell::Visitor& visitor)
-{
- Base::visit_edges(visitor);
- visitor.visit(&m_object);
-}
-
-Optional<Variable> WithScope::get_from_scope(const FlyString& name) const
-{
- auto value = m_object.get(name);
- if (value.is_empty())
- return {};
- return Variable { value, DeclarationKind::Var };
-}
-
-void WithScope::put_to_scope(const FlyString& name, Variable variable)
-{
- m_object.put(name, variable.value);
-}
-
-bool WithScope::delete_from_scope(FlyString const& name)
-{
- return m_object.delete_property(name);
-}
-
-bool WithScope::has_this_binding() const
-{
- return parent()->has_this_binding();
-}
-
-Value WithScope::get_this_binding(GlobalObject& global_object) const
-{
- return parent()->get_this_binding(global_object);
-}
-
-}