| OLD | NEW |
| 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/parsing/parser.h" | 5 #include "src/parsing/parser.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
| 9 #include "src/ast/ast-expression-rewriter.h" | 9 #include "src/ast/ast-expression-rewriter.h" |
| 10 #include "src/ast/ast-expression-visitor.h" | 10 #include "src/ast/ast-expression-visitor.h" |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 } | 627 } |
| 628 | 628 |
| 629 | 629 |
| 630 Expression* ParserTraits::ThisExpression(Scope* scope, AstNodeFactory* factory, | 630 Expression* ParserTraits::ThisExpression(Scope* scope, AstNodeFactory* factory, |
| 631 int pos) { | 631 int pos) { |
| 632 return scope->NewUnresolved(factory, | 632 return scope->NewUnresolved(factory, |
| 633 parser_->ast_value_factory()->this_string(), | 633 parser_->ast_value_factory()->this_string(), |
| 634 Variable::THIS, pos, pos + 4); | 634 Variable::THIS, pos, pos + 4); |
| 635 } | 635 } |
| 636 | 636 |
| 637 | 637 Expression* ParserTraits::NewSuperPropertyReference(Scope* scope, |
| 638 Expression* ParserTraits::SuperPropertyReference(Scope* scope, | 638 AstNodeFactory* factory, |
| 639 AstNodeFactory* factory, | 639 int pos) { |
| 640 int pos) { | |
| 641 // this_function[home_object_symbol] | 640 // this_function[home_object_symbol] |
| 642 VariableProxy* this_function_proxy = scope->NewUnresolved( | 641 VariableProxy* this_function_proxy = scope->NewUnresolved( |
| 643 factory, parser_->ast_value_factory()->this_function_string(), | 642 factory, parser_->ast_value_factory()->this_function_string(), |
| 644 Variable::NORMAL, pos); | 643 Variable::NORMAL, pos); |
| 645 Expression* home_object_symbol_literal = | 644 Expression* home_object_symbol_literal = |
| 646 factory->NewSymbolLiteral("home_object_symbol", kNoSourcePosition); | 645 factory->NewSymbolLiteral("home_object_symbol", kNoSourcePosition); |
| 647 Expression* home_object = factory->NewProperty( | 646 Expression* home_object = factory->NewProperty( |
| 648 this_function_proxy, home_object_symbol_literal, pos); | 647 this_function_proxy, home_object_symbol_literal, pos); |
| 649 return factory->NewSuperPropertyReference( | 648 return factory->NewSuperPropertyReference( |
| 650 ThisExpression(scope, factory, pos)->AsVariableProxy(), home_object, pos); | 649 ThisExpression(scope, factory, pos)->AsVariableProxy(), home_object, pos); |
| 651 } | 650 } |
| 652 | 651 |
| 653 | 652 Expression* ParserTraits::NewSuperCallReference(Scope* scope, |
| 654 Expression* ParserTraits::SuperCallReference(Scope* scope, | 653 AstNodeFactory* factory, |
| 655 AstNodeFactory* factory, int pos) { | 654 int pos) { |
| 656 VariableProxy* new_target_proxy = scope->NewUnresolved( | 655 VariableProxy* new_target_proxy = scope->NewUnresolved( |
| 657 factory, parser_->ast_value_factory()->new_target_string(), | 656 factory, parser_->ast_value_factory()->new_target_string(), |
| 658 Variable::NORMAL, pos); | 657 Variable::NORMAL, pos); |
| 659 VariableProxy* this_function_proxy = scope->NewUnresolved( | 658 VariableProxy* this_function_proxy = scope->NewUnresolved( |
| 660 factory, parser_->ast_value_factory()->this_function_string(), | 659 factory, parser_->ast_value_factory()->this_function_string(), |
| 661 Variable::NORMAL, pos); | 660 Variable::NORMAL, pos); |
| 662 return factory->NewSuperCallReference( | 661 return factory->NewSuperCallReference( |
| 663 ThisExpression(scope, factory, pos)->AsVariableProxy(), new_target_proxy, | 662 ThisExpression(scope, factory, pos)->AsVariableProxy(), new_target_proxy, |
| 664 this_function_proxy, pos); | 663 this_function_proxy, pos); |
| 665 } | 664 } |
| (...skipping 6384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7050 | 7049 |
| 7051 #ifdef DEBUG | 7050 #ifdef DEBUG |
| 7052 void Parser::Print(AstNode* node) { | 7051 void Parser::Print(AstNode* node) { |
| 7053 ast_value_factory()->Internalize(Isolate::Current()); | 7052 ast_value_factory()->Internalize(Isolate::Current()); |
| 7054 node->Print(Isolate::Current()); | 7053 node->Print(Isolate::Current()); |
| 7055 } | 7054 } |
| 7056 #endif // DEBUG | 7055 #endif // DEBUG |
| 7057 | 7056 |
| 7058 } // namespace internal | 7057 } // namespace internal |
| 7059 } // namespace v8 | 7058 } // namespace v8 |
| OLD | NEW |