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