LibJS: Remove unused DeclarativeEnvironmentRecord::type()
Nothing was using this, and we now have separate classes for the different types of environment records instead.
This commit is contained in:
parent
0cd65b55bd
commit
ce2747692d
Notes:
sideshowbarker
2024-07-18 11:35:20 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ce2747692d3
3 changed files with 1 additions and 26 deletions
|
@ -18,12 +18,6 @@ DeclarativeEnvironmentRecord::DeclarativeEnvironmentRecord()
|
|||
{
|
||||
}
|
||||
|
||||
DeclarativeEnvironmentRecord::DeclarativeEnvironmentRecord(EnvironmentRecordType environment_record_type)
|
||||
: EnvironmentRecord(nullptr)
|
||||
, m_environment_record_type(environment_record_type)
|
||||
{
|
||||
}
|
||||
|
||||
DeclarativeEnvironmentRecord::DeclarativeEnvironmentRecord(EnvironmentRecord* parent_scope)
|
||||
: EnvironmentRecord(parent_scope)
|
||||
{
|
||||
|
@ -35,13 +29,6 @@ DeclarativeEnvironmentRecord::DeclarativeEnvironmentRecord(HashMap<FlyString, Va
|
|||
{
|
||||
}
|
||||
|
||||
DeclarativeEnvironmentRecord::DeclarativeEnvironmentRecord(HashMap<FlyString, Variable> variables, EnvironmentRecord* parent_scope, EnvironmentRecordType environment_record_type)
|
||||
: EnvironmentRecord(parent_scope)
|
||||
, m_environment_record_type(environment_record_type)
|
||||
, m_variables(move(variables))
|
||||
{
|
||||
}
|
||||
|
||||
DeclarativeEnvironmentRecord::~DeclarativeEnvironmentRecord()
|
||||
{
|
||||
}
|
||||
|
|
|
@ -25,18 +25,9 @@ class DeclarativeEnvironmentRecord : public EnvironmentRecord {
|
|||
JS_ENVIRONMENT_RECORD(DeclarativeEnvironmentRecord, EnvironmentRecord);
|
||||
|
||||
public:
|
||||
enum class EnvironmentRecordType {
|
||||
Declarative,
|
||||
Function,
|
||||
Object,
|
||||
Module,
|
||||
};
|
||||
|
||||
DeclarativeEnvironmentRecord();
|
||||
DeclarativeEnvironmentRecord(EnvironmentRecordType);
|
||||
explicit DeclarativeEnvironmentRecord(EnvironmentRecord* parent_scope);
|
||||
DeclarativeEnvironmentRecord(HashMap<FlyString, Variable> variables, EnvironmentRecord* parent_scope);
|
||||
DeclarativeEnvironmentRecord(HashMap<FlyString, Variable> variables, EnvironmentRecord* parent_scope, EnvironmentRecordType);
|
||||
virtual ~DeclarativeEnvironmentRecord() override;
|
||||
|
||||
// ^EnvironmentRecord
|
||||
|
@ -46,8 +37,6 @@ public:
|
|||
|
||||
HashMap<FlyString, Variable> const& variables() const { return m_variables; }
|
||||
|
||||
EnvironmentRecordType type() const { return m_environment_record_type; }
|
||||
|
||||
virtual bool has_binding(FlyString const& name) const override;
|
||||
virtual void create_mutable_binding(GlobalObject&, FlyString const& name, bool can_be_deleted) override;
|
||||
virtual void create_immutable_binding(GlobalObject&, FlyString const& name, bool strict) override;
|
||||
|
@ -62,7 +51,6 @@ protected:
|
|||
private:
|
||||
virtual bool is_declarative_environment_record() const override { return true; }
|
||||
|
||||
EnvironmentRecordType m_environment_record_type : 8 { EnvironmentRecordType::Declarative };
|
||||
HashMap<FlyString, Variable> m_variables;
|
||||
HashMap<FlyString, Binding> m_bindings;
|
||||
};
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
namespace JS {
|
||||
|
||||
FunctionEnvironmentRecord::FunctionEnvironmentRecord(EnvironmentRecord* parent_scope, HashMap<FlyString, Variable> variables)
|
||||
: DeclarativeEnvironmentRecord(variables, parent_scope, DeclarativeEnvironmentRecord::EnvironmentRecordType::Function)
|
||||
: DeclarativeEnvironmentRecord(variables, parent_scope)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue