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

Side by Side Diff: src/ast-numbering.cc

Issue 722793005: Classes: Implement correct name binding (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/ast.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/scopes.h" 10 #include "src/scopes.h"
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 if (node->next() != NULL) Visit(node->next()); 363 if (node->next() != NULL) Visit(node->next());
364 Visit(node->body()); 364 Visit(node->body());
365 } 365 }
366 366
367 367
368 void AstNumberingVisitor::VisitClassLiteral(ClassLiteral* node) { 368 void AstNumberingVisitor::VisitClassLiteral(ClassLiteral* node) {
369 IncrementNodeCount(); 369 IncrementNodeCount();
370 node->set_base_id(ReserveIdRange(ClassLiteral::num_ids())); 370 node->set_base_id(ReserveIdRange(ClassLiteral::num_ids()));
371 if (node->extends()) Visit(node->extends()); 371 if (node->extends()) Visit(node->extends());
372 if (node->constructor()) Visit(node->constructor()); 372 if (node->constructor()) Visit(node->constructor());
373 if (node->proxy()) VisitVariableProxy(node->proxy());
373 for (int i = 0; i < node->properties()->length(); i++) { 374 for (int i = 0; i < node->properties()->length(); i++) {
374 VisitObjectLiteralProperty(node->properties()->at(i)); 375 VisitObjectLiteralProperty(node->properties()->at(i));
375 } 376 }
376 } 377 }
377 378
378 379
379 void AstNumberingVisitor::VisitObjectLiteral(ObjectLiteral* node) { 380 void AstNumberingVisitor::VisitObjectLiteral(ObjectLiteral* node) {
380 IncrementNodeCount(); 381 IncrementNodeCount();
381 node->set_base_id(ReserveIdRange(ObjectLiteral::num_ids())); 382 node->set_base_id(ReserveIdRange(ObjectLiteral::num_ids()));
382 for (int i = 0; i < node->properties()->length(); i++) { 383 for (int i = 0; i < node->properties()->length(); i++) {
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 } 471 }
471 472
472 473
473 bool AstNumbering::Renumber(FunctionLiteral* function, Zone* zone) { 474 bool AstNumbering::Renumber(FunctionLiteral* function, Zone* zone) {
474 AstNumberingVisitor visitor(zone); 475 AstNumberingVisitor visitor(zone);
475 visitor.Renumber(function); 476 visitor.Renumber(function);
476 return !visitor.HasStackOverflow(); 477 return !visitor.HasStackOverflow();
477 } 478 }
478 } 479 }
479 } // namespace v8::internal 480 } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698