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

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: 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
Index: src/parsing/parameter-initializer-rewriter.cc
diff --git a/src/parsing/parameter-initializer-rewriter.cc b/src/parsing/parameter-initializer-rewriter.cc
index 4bb367d7d08ba91dae3ac67a42a4a3705455f179..dbf49157c0ec6d651e56da32da599800f7f82a31 100644
--- a/src/parsing/parameter-initializer-rewriter.cc
+++ b/src/parsing/parameter-initializer-rewriter.cc
@@ -8,9 +8,7 @@
#include <utility>
#include <vector>
-#include "src/ast/ast.h"
-#include "src/ast/ast-expression-visitor.h"
-#include "src/ast/scopes.h"
+#include "src/ast/ast-traversal-visitor.h"
namespace v8 {
namespace internal {
@@ -18,28 +16,29 @@ namespace internal {
namespace {
-class Rewriter final : public AstExpressionVisitor {
+class Rewriter final : public AstTraversalVisitor<Rewriter> {
public:
Rewriter(uintptr_t stack_limit, Expression* initializer, Scope* old_scope,
Scope* new_scope)
- : AstExpressionVisitor(stack_limit, initializer),
+ : AstTraversalVisitor(stack_limit, initializer),
old_scope_(old_scope),
new_scope_(new_scope),
old_scope_closure_(old_scope->ClosureScope()),
new_scope_closure_(new_scope->ClosureScope()) {}
~Rewriter();
- private:
- void VisitExpression(Expression* expr) override {}
+ protected:
adamk 2016/07/21 18:11:57 "protected" + "final" doesn't make sense to me. Pr
nickie 2016/07/22 08:40:18 You're right. I'm making them private again. The
+ 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);
+ private:
Scope* old_scope_;
Scope* new_scope_;
Scope* old_scope_closure_;

Powered by Google App Engine
This is Rietveld 408576698