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

Side by Side Diff: src/ast/ast-literal-reindexer.cc

Issue 2142333002: Refactor class declaration logic to the parser and runtime Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: minor cleanup per Adam 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698