Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Unified Diff: src/parsing/parameter-initializer-rewriter.cc

Issue 2169833002: [parser] Refactor AstTraversalVisitor (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/debug/liveedit.cc ('k') | src/parsing/parser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/parameter-initializer-rewriter.cc
diff --git a/src/parsing/parameter-initializer-rewriter.cc b/src/parsing/parameter-initializer-rewriter.cc
index 7a19138069ab525422e93f30fd02c86df204cc9f..54b0c39a2f79601b64fe9d5661e6fef97d9b0335 100644
--- a/src/parsing/parameter-initializer-rewriter.cc
+++ b/src/parsing/parameter-initializer-rewriter.cc
@@ -5,7 +5,7 @@
#include "src/parsing/parameter-initializer-rewriter.h"
#include "src/ast/ast.h"
-#include "src/ast/ast-expression-visitor.h"
+#include "src/ast/ast-traversal-visitor.h"
#include "src/ast/scopes.h"
namespace v8 {
@@ -14,22 +14,24 @@ namespace internal {
namespace {
-class Rewriter final : public AstExpressionVisitor {
+class Rewriter final : public AstTraversalVisitor<Rewriter> {
public:
Rewriter(uintptr_t stack_limit, Expression* initializer, Scope* param_scope)
- : AstExpressionVisitor(stack_limit, initializer),
+ : AstTraversalVisitor(stack_limit, initializer),
param_scope_(param_scope) {}
private:
- void VisitExpression(Expression* expr) override {}
+ // This is required so that the overriden Visit* methods can be
+ // called by the base class (template).
+ friend class AstTraversalVisitor<Rewriter>;
- void VisitFunctionLiteral(FunctionLiteral* expr) override;
- void VisitClassLiteral(ClassLiteral* expr) override;
- void VisitVariableProxy(VariableProxy* expr) override;
+ void VisitFunctionLiteral(FunctionLiteral* expr);
+ void VisitClassLiteral(ClassLiteral* expr);
+ void VisitVariableProxy(VariableProxy* expr);
- void VisitBlock(Block* stmt) override;
- void VisitTryCatchStatement(TryCatchStatement* stmt) override;
- void VisitWithStatement(WithStatement* stmt) override;
+ void VisitBlock(Block* stmt);
+ void VisitTryCatchStatement(TryCatchStatement* stmt);
+ void VisitWithStatement(WithStatement* stmt);
Scope* param_scope_;
};
« no previous file with comments | « src/debug/liveedit.cc ('k') | src/parsing/parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698