mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:27:35 +00:00
LibJS: rename JS::DeclarationType => JS::DeclarationKind
Many other parsers call it with this name. Also Type can be confusing in this context since the DeclarationType is not the type (number, string, etc.) of the variables that are being declared by the VariableDeclaration.
This commit is contained in:
parent
44f8161166
commit
38dfd04633
6 changed files with 37 additions and 37 deletions
|
@ -591,7 +591,7 @@ private:
|
|||
bool m_prefixed;
|
||||
};
|
||||
|
||||
enum class DeclarationType {
|
||||
enum class DeclarationKind {
|
||||
Var,
|
||||
Let,
|
||||
Const,
|
||||
|
@ -620,14 +620,14 @@ private:
|
|||
|
||||
class VariableDeclaration : public Declaration {
|
||||
public:
|
||||
VariableDeclaration(DeclarationType declaration_type, NonnullRefPtrVector<VariableDeclarator> declarations)
|
||||
: m_declaration_type(declaration_type)
|
||||
VariableDeclaration(DeclarationKind declaration_kind, NonnullRefPtrVector<VariableDeclarator> declarations)
|
||||
: m_declaration_kind(declaration_kind)
|
||||
, m_declarations(move(declarations))
|
||||
{
|
||||
}
|
||||
|
||||
virtual bool is_variable_declaration() const override { return true; }
|
||||
DeclarationType declaration_type() const { return m_declaration_type; }
|
||||
DeclarationKind declaration_kind() const { return m_declaration_kind; }
|
||||
|
||||
virtual Value execute(Interpreter&) const override;
|
||||
virtual void dump(int indent) const override;
|
||||
|
@ -635,7 +635,7 @@ public:
|
|||
private:
|
||||
virtual const char* class_name() const override { return "VariableDeclaration"; }
|
||||
|
||||
DeclarationType m_declaration_type;
|
||||
DeclarationKind m_declaration_kind;
|
||||
NonnullRefPtrVector<VariableDeclarator> m_declarations;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue