| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/ast/ast-literal-reindexer.h" | 5 #include "src/ast/ast-literal-reindexer.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 | 9 |
| 10 namespace v8 { | 10 namespace v8 { |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 | 241 |
| 242 void AstLiteralReindexer::VisitForStatement(ForStatement* node) { | 242 void AstLiteralReindexer::VisitForStatement(ForStatement* node) { |
| 243 if (node->init() != NULL) Visit(node->init()); | 243 if (node->init() != NULL) Visit(node->init()); |
| 244 if (node->cond() != NULL) Visit(node->cond()); | 244 if (node->cond() != NULL) Visit(node->cond()); |
| 245 if (node->next() != NULL) Visit(node->next()); | 245 if (node->next() != NULL) Visit(node->next()); |
| 246 Visit(node->body()); | 246 Visit(node->body()); |
| 247 } | 247 } |
| 248 | 248 |
| 249 | 249 |
| 250 void AstLiteralReindexer::VisitClassLiteral(ClassLiteral* node) { | |
| 251 if (node->extends()) Visit(node->extends()); | |
| 252 if (node->constructor()) Visit(node->constructor()); | |
| 253 if (node->class_variable_proxy()) { | |
| 254 VisitVariableProxy(node->class_variable_proxy()); | |
| 255 } | |
| 256 for (int i = 0; i < node->properties()->length(); i++) { | |
| 257 VisitObjectLiteralProperty(node->properties()->at(i)); | |
| 258 } | |
| 259 } | |
| 260 | |
| 261 | |
| 262 void AstLiteralReindexer::VisitObjectLiteral(ObjectLiteral* node) { | 250 void AstLiteralReindexer::VisitObjectLiteral(ObjectLiteral* node) { |
| 263 UpdateIndex(node); | 251 UpdateIndex(node); |
| 264 for (int i = 0; i < node->properties()->length(); i++) { | 252 for (int i = 0; i < node->properties()->length(); i++) { |
| 265 VisitObjectLiteralProperty(node->properties()->at(i)); | 253 VisitObjectLiteralProperty(node->properties()->at(i)); |
| 266 } | 254 } |
| 267 } | 255 } |
| 268 | 256 |
| 269 | 257 |
| 270 void AstLiteralReindexer::VisitObjectLiteralProperty( | 258 void AstLiteralReindexer::VisitObjectLiteralProperty( |
| 271 ObjectLiteralProperty* node) { | 259 ObjectLiteralProperty* node) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 void AstLiteralReindexer::VisitFunctionLiteral(FunctionLiteral* node) { | 308 void AstLiteralReindexer::VisitFunctionLiteral(FunctionLiteral* node) { |
| 321 // We don't recurse into the declarations or body of the function literal: | 309 // We don't recurse into the declarations or body of the function literal: |
| 322 } | 310 } |
| 323 | 311 |
| 324 | 312 |
| 325 void AstLiteralReindexer::Reindex(Expression* pattern) { | 313 void AstLiteralReindexer::Reindex(Expression* pattern) { |
| 326 pattern->Accept(this); | 314 pattern->Accept(this); |
| 327 } | 315 } |
| 328 } // namespace internal | 316 } // namespace internal |
| 329 } // namespace v8 | 317 } // namespace v8 |
| OLD | NEW |