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

Side by Side Diff: src/parser.cc

Issue 418143007: FYI Implementing 'super' keyword (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: one more test Created 6 years, 4 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 | 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/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/base/platform/platform.h" 9 #include "src/base/platform/platform.h"
10 #include "src/bootstrapper.h" 10 #include "src/bootstrapper.h"
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 const AstRawString* ParserTraits::GetNextSymbol(Scanner* scanner) { 612 const AstRawString* ParserTraits::GetNextSymbol(Scanner* scanner) {
613 return parser_->scanner()->NextSymbol(parser_->ast_value_factory_); 613 return parser_->scanner()->NextSymbol(parser_->ast_value_factory_);
614 } 614 }
615 615
616 616
617 Expression* ParserTraits::ThisExpression( 617 Expression* ParserTraits::ThisExpression(
618 Scope* scope, AstNodeFactory<AstConstructionVisitor>* factory, int pos) { 618 Scope* scope, AstNodeFactory<AstConstructionVisitor>* factory, int pos) {
619 return factory->NewVariableProxy(scope->receiver(), pos); 619 return factory->NewVariableProxy(scope->receiver(), pos);
620 } 620 }
621 621
622 Expression* ParserTraits::SuperReference(
623 Scope* scope, AstNodeFactory<AstConstructionVisitor>* factory, int pos) {
624 return factory->NewSuperReference(
625 ThisExpression(scope, factory, pos)->AsVariableProxy(),
626 pos);
627 }
622 628
623 Literal* ParserTraits::ExpressionFromLiteral( 629 Literal* ParserTraits::ExpressionFromLiteral(
624 Token::Value token, int pos, 630 Token::Value token, int pos,
625 Scanner* scanner, 631 Scanner* scanner,
626 AstNodeFactory<AstConstructionVisitor>* factory) { 632 AstNodeFactory<AstConstructionVisitor>* factory) {
627 switch (token) { 633 switch (token) {
628 case Token::NULL_LITERAL: 634 case Token::NULL_LITERAL:
629 return factory->NewNullLiteral(pos); 635 return factory->NewNullLiteral(pos);
630 case Token::TRUE_LITERAL: 636 case Token::TRUE_LITERAL:
631 return factory->NewBooleanLiteral(true, pos); 637 return factory->NewBooleanLiteral(true, pos);
(...skipping 4172 matching lines...) Expand 10 before | Expand all | Expand 10 after
4804 info()->SetAstValueFactory(ast_value_factory_); 4810 info()->SetAstValueFactory(ast_value_factory_);
4805 } 4811 }
4806 ast_value_factory_ = NULL; 4812 ast_value_factory_ = NULL;
4807 4813
4808 InternalizeUseCounts(); 4814 InternalizeUseCounts();
4809 4815
4810 return (result != NULL); 4816 return (result != NULL);
4811 } 4817 }
4812 4818
4813 } } // namespace v8::internal 4819 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698