| 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 factory, parser_->ast_value_factory()->new_target_string(), | 673 factory, parser_->ast_value_factory()->new_target_string(), |
| 674 Variable::NORMAL, pos, pos + kNewTargetStringLength); | 674 Variable::NORMAL, pos, pos + kNewTargetStringLength); |
| 675 proxy->set_is_new_target(); | 675 proxy->set_is_new_target(); |
| 676 return proxy; | 676 return proxy; |
| 677 } | 677 } |
| 678 | 678 |
| 679 | 679 |
| 680 Expression* ParserTraits::FunctionSentExpression(Scope* scope, | 680 Expression* ParserTraits::FunctionSentExpression(Scope* scope, |
| 681 AstNodeFactory* factory, | 681 AstNodeFactory* factory, |
| 682 int pos) { | 682 int pos) { |
| 683 // We desugar function.sent into %_GeneratorGetInput(generator). | 683 // We desugar function.sent into %_GeneratorGetInputOrDebugPos(generator). |
| 684 Zone* zone = parser_->zone(); | 684 Zone* zone = parser_->zone(); |
| 685 ZoneList<Expression*>* args = new (zone) ZoneList<Expression*>(1, zone); | 685 ZoneList<Expression*>* args = new (zone) ZoneList<Expression*>(1, zone); |
| 686 VariableProxy* generator = factory->NewVariableProxy( | 686 VariableProxy* generator = factory->NewVariableProxy( |
| 687 parser_->function_state_->generator_object_variable()); | 687 parser_->function_state_->generator_object_variable()); |
| 688 args->Add(generator, zone); | 688 args->Add(generator, zone); |
| 689 return factory->NewCallRuntime(Runtime::kInlineGeneratorGetInput, args, pos); | 689 return factory->NewCallRuntime(Runtime::kInlineGeneratorGetInputOrDebugPos, |
| 690 args, pos); |
| 690 } | 691 } |
| 691 | 692 |
| 692 | 693 |
| 693 Literal* ParserTraits::ExpressionFromLiteral(Token::Value token, int pos, | 694 Literal* ParserTraits::ExpressionFromLiteral(Token::Value token, int pos, |
| 694 Scanner* scanner, | 695 Scanner* scanner, |
| 695 AstNodeFactory* factory) { | 696 AstNodeFactory* factory) { |
| 696 switch (token) { | 697 switch (token) { |
| 697 case Token::NULL_LITERAL: | 698 case Token::NULL_LITERAL: |
| 698 return factory->NewNullLiteral(pos); | 699 return factory->NewNullLiteral(pos); |
| 699 case Token::TRUE_LITERAL: | 700 case Token::TRUE_LITERAL: |
| (...skipping 6278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6978 try_block, target); | 6979 try_block, target); |
| 6979 final_loop = target; | 6980 final_loop = target; |
| 6980 } | 6981 } |
| 6981 | 6982 |
| 6982 return final_loop; | 6983 return final_loop; |
| 6983 } | 6984 } |
| 6984 | 6985 |
| 6985 | 6986 |
| 6986 } // namespace internal | 6987 } // namespace internal |
| 6987 } // namespace v8 | 6988 } // namespace v8 |
| OLD | NEW |