Index: src/ast-expression-visitor.cc |
diff --git a/src/ast-expression-visitor.cc b/src/ast-expression-visitor.cc |
index bbe8e9b67639fdf46672b61eb5edc73276f55704..7656420614826359fe0722dd959f073348e62ef7 100644 |
--- a/src/ast-expression-visitor.cc |
+++ b/src/ast-expression-visitor.cc |
@@ -32,14 +32,20 @@ namespace internal { |
} while (false) |
-AstExpressionVisitor::AstExpressionVisitor(Isolate* isolate, |
- FunctionLiteral* root) |
+AstExpressionVisitor::AstExpressionVisitor(Isolate* isolate, Expression* root) |
: root_(root), depth_(0) { |
InitializeAstVisitor(isolate); |
} |
-void AstExpressionVisitor::Run() { RECURSE(VisitFunctionLiteral(root_)); } |
+AstExpressionVisitor::AstExpressionVisitor(uintptr_t stack_limit, |
+ Expression* root) |
+ : root_(root), depth_(0) { |
+ InitializeAstVisitor(stack_limit); |
+} |
+ |
+ |
+void AstExpressionVisitor::Run() { RECURSE(Visit(root_)); } |
void AstExpressionVisitor::VisitVariableDeclaration(VariableDeclaration* decl) { |
@@ -229,6 +235,9 @@ void AstExpressionVisitor::VisitObjectLiteral(ObjectLiteral* expr) { |
ZoneList<ObjectLiteralProperty*>* props = expr->properties(); |
for (int i = 0; i < props->length(); ++i) { |
ObjectLiteralProperty* prop = props->at(i); |
+ if (!prop->key()->IsLiteral()) { |
+ RECURSE_EXPRESSION(Visit(prop->key())); |
+ } |
RECURSE_EXPRESSION(Visit(prop->value())); |
} |
} |
@@ -342,10 +351,27 @@ void AstExpressionVisitor::VisitDeclarations(ZoneList<Declaration*>* decls) { |
} |
-void AstExpressionVisitor::VisitClassLiteral(ClassLiteral* expr) {} |
+void AstExpressionVisitor::VisitClassLiteral(ClassLiteral* expr) { |
+ VisitExpression(expr); |
+ if (expr->extends() != nullptr) { |
+ RECURSE_EXPRESSION(Visit(expr->extends())); |
+ } |
+ RECURSE_EXPRESSION(Visit(expr->constructor())); |
+ ZoneList<ObjectLiteralProperty*>* props = expr->properties(); |
+ for (int i = 0; i < props->length(); ++i) { |
+ ObjectLiteralProperty* prop = props->at(i); |
+ if (!prop->key()->IsLiteral()) { |
+ RECURSE_EXPRESSION(Visit(prop->key())); |
+ } |
+ RECURSE_EXPRESSION(Visit(prop->value())); |
+ } |
+} |
-void AstExpressionVisitor::VisitSpread(Spread* expr) {} |
+void AstExpressionVisitor::VisitSpread(Spread* expr) { |
+ VisitExpression(expr); |
+ RECURSE_EXPRESSION(Visit(expr->expression())); |
+} |
void AstExpressionVisitor::VisitEmptyParentheses(EmptyParentheses* expr) {} |