1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 08:27:45 +00:00

LibJS: Mark more ASTNode classes as final

This commit is contained in:
Linus Groh 2020-09-16 19:13:32 +01:00 committed by Andreas Kling
parent b82a254da0
commit fd32f00839

View file

@ -143,7 +143,7 @@ private:
bool m_strict_mode { false }; bool m_strict_mode { false };
}; };
class Program : public ScopeNode { class Program final : public ScopeNode {
public: public:
Program() { } Program() { }
@ -152,7 +152,7 @@ private:
virtual const char* class_name() const override { return "Program"; } virtual const char* class_name() const override { return "Program"; }
}; };
class BlockStatement : public ScopeNode { class BlockStatement final : public ScopeNode {
public: public:
BlockStatement() { } BlockStatement() { }
@ -248,7 +248,7 @@ public:
const char* class_name() const override { return "ErrorExpression"; } const char* class_name() const override { return "ErrorExpression"; }
}; };
class ReturnStatement : public Statement { class ReturnStatement final : public Statement {
public: public:
explicit ReturnStatement(RefPtr<Expression> argument) explicit ReturnStatement(RefPtr<Expression> argument)
: m_argument(move(argument)) : m_argument(move(argument))
@ -266,7 +266,7 @@ private:
RefPtr<Expression> m_argument; RefPtr<Expression> m_argument;
}; };
class IfStatement : public Statement { class IfStatement final : public Statement {
public: public:
IfStatement(NonnullRefPtr<Expression> predicate, NonnullRefPtr<Statement> consequent, RefPtr<Statement> alternate) IfStatement(NonnullRefPtr<Expression> predicate, NonnullRefPtr<Statement> consequent, RefPtr<Statement> alternate)
: m_predicate(move(predicate)) : m_predicate(move(predicate))
@ -290,7 +290,7 @@ private:
RefPtr<Statement> m_alternate; RefPtr<Statement> m_alternate;
}; };
class WhileStatement : public Statement { class WhileStatement final : public Statement {
public: public:
WhileStatement(NonnullRefPtr<Expression> test, NonnullRefPtr<Statement> body) WhileStatement(NonnullRefPtr<Expression> test, NonnullRefPtr<Statement> body)
: m_test(move(test)) : m_test(move(test))
@ -311,7 +311,7 @@ private:
NonnullRefPtr<Statement> m_body; NonnullRefPtr<Statement> m_body;
}; };
class DoWhileStatement : public Statement { class DoWhileStatement final : public Statement {
public: public:
DoWhileStatement(NonnullRefPtr<Expression> test, NonnullRefPtr<Statement> body) DoWhileStatement(NonnullRefPtr<Expression> test, NonnullRefPtr<Statement> body)
: m_test(move(test)) : m_test(move(test))
@ -332,7 +332,7 @@ private:
NonnullRefPtr<Statement> m_body; NonnullRefPtr<Statement> m_body;
}; };
class ForStatement : public Statement { class ForStatement final : public Statement {
public: public:
ForStatement(RefPtr<ASTNode> init, RefPtr<Expression> test, RefPtr<Expression> update, NonnullRefPtr<Statement> body) ForStatement(RefPtr<ASTNode> init, RefPtr<Expression> test, RefPtr<Expression> update, NonnullRefPtr<Statement> body)
: m_init(move(init)) : m_init(move(init))
@ -359,7 +359,7 @@ private:
NonnullRefPtr<Statement> m_body; NonnullRefPtr<Statement> m_body;
}; };
class ForInStatement : public Statement { class ForInStatement final : public Statement {
public: public:
ForInStatement(NonnullRefPtr<ASTNode> lhs, NonnullRefPtr<Expression> rhs, NonnullRefPtr<Statement> body) ForInStatement(NonnullRefPtr<ASTNode> lhs, NonnullRefPtr<Expression> rhs, NonnullRefPtr<Statement> body)
: m_lhs(move(lhs)) : m_lhs(move(lhs))
@ -383,7 +383,7 @@ private:
NonnullRefPtr<Statement> m_body; NonnullRefPtr<Statement> m_body;
}; };
class ForOfStatement : public Statement { class ForOfStatement final : public Statement {
public: public:
ForOfStatement(NonnullRefPtr<ASTNode> lhs, NonnullRefPtr<Expression> rhs, NonnullRefPtr<Statement> body) ForOfStatement(NonnullRefPtr<ASTNode> lhs, NonnullRefPtr<Expression> rhs, NonnullRefPtr<Statement> body)
: m_lhs(move(lhs)) : m_lhs(move(lhs))
@ -432,7 +432,7 @@ enum class BinaryOp {
InstanceOf, InstanceOf,
}; };
class BinaryExpression : public Expression { class BinaryExpression final : public Expression {
public: public:
BinaryExpression(BinaryOp op, NonnullRefPtr<Expression> lhs, NonnullRefPtr<Expression> rhs) BinaryExpression(BinaryOp op, NonnullRefPtr<Expression> lhs, NonnullRefPtr<Expression> rhs)
: m_op(op) : m_op(op)
@ -458,7 +458,7 @@ enum class LogicalOp {
NullishCoalescing, NullishCoalescing,
}; };
class LogicalExpression : public Expression { class LogicalExpression final : public Expression {
public: public:
LogicalExpression(LogicalOp op, NonnullRefPtr<Expression> lhs, NonnullRefPtr<Expression> rhs) LogicalExpression(LogicalOp op, NonnullRefPtr<Expression> lhs, NonnullRefPtr<Expression> rhs)
: m_op(op) : m_op(op)
@ -488,7 +488,7 @@ enum class UnaryOp {
Delete, Delete,
}; };
class UnaryExpression : public Expression { class UnaryExpression final : public Expression {
public: public:
UnaryExpression(UnaryOp op, NonnullRefPtr<Expression> lhs) UnaryExpression(UnaryOp op, NonnullRefPtr<Expression> lhs)
: m_op(op) : m_op(op)
@ -811,7 +811,7 @@ enum class AssignmentOp {
UnsignedRightShiftAssignment, UnsignedRightShiftAssignment,
}; };
class AssignmentExpression : public Expression { class AssignmentExpression final : public Expression {
public: public:
AssignmentExpression(AssignmentOp op, NonnullRefPtr<Expression> lhs, NonnullRefPtr<Expression> rhs) AssignmentExpression(AssignmentOp op, NonnullRefPtr<Expression> lhs, NonnullRefPtr<Expression> rhs)
: m_op(op) : m_op(op)
@ -836,7 +836,7 @@ enum class UpdateOp {
Decrement, Decrement,
}; };
class UpdateExpression : public Expression { class UpdateExpression final : public Expression {
public: public:
UpdateExpression(UpdateOp op, NonnullRefPtr<Expression> argument, bool prefixed = false) UpdateExpression(UpdateOp op, NonnullRefPtr<Expression> argument, bool prefixed = false)
: m_op(op) : m_op(op)
@ -888,7 +888,7 @@ private:
RefPtr<Expression> m_init; RefPtr<Expression> m_init;
}; };
class VariableDeclaration : public Declaration { class VariableDeclaration final : public Declaration {
public: public:
VariableDeclaration(DeclarationKind declaration_kind, NonnullRefPtrVector<VariableDeclarator> declarations) VariableDeclaration(DeclarationKind declaration_kind, NonnullRefPtrVector<VariableDeclarator> declarations)
: m_declaration_kind(declaration_kind) : m_declaration_kind(declaration_kind)
@ -950,7 +950,7 @@ private:
bool m_is_method { false }; bool m_is_method { false };
}; };
class ObjectExpression : public Expression { class ObjectExpression final : public Expression {
public: public:
ObjectExpression(NonnullRefPtrVector<ObjectProperty> properties = {}) ObjectExpression(NonnullRefPtrVector<ObjectProperty> properties = {})
: m_properties(move(properties)) : m_properties(move(properties))
@ -966,7 +966,7 @@ private:
NonnullRefPtrVector<ObjectProperty> m_properties; NonnullRefPtrVector<ObjectProperty> m_properties;
}; };
class ArrayExpression : public Expression { class ArrayExpression final : public Expression {
public: public:
ArrayExpression(Vector<RefPtr<Expression>> elements) ArrayExpression(Vector<RefPtr<Expression>> elements)
: m_elements(move(elements)) : m_elements(move(elements))