OLD | NEW |
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.h" | 5 #include "src/ast/ast.h" |
6 #include "src/messages.h" | 6 #include "src/messages.h" |
7 #include "src/objects-inl.h" | 7 #include "src/objects-inl.h" |
8 #include "src/parsing/parameter-initializer-rewriter.h" | 8 #include "src/parsing/parameter-initializer-rewriter.h" |
9 #include "src/parsing/parser.h" | 9 #include "src/parsing/parser.h" |
10 | 10 |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 // if (!result.done) { | 555 // if (!result.done) { |
556 // %AppendElement(array, result.value); | 556 // %AppendElement(array, result.value); |
557 // done = false; | 557 // done = false; |
558 // } | 558 // } |
559 // } | 559 // } |
560 | 560 |
561 // let array = []; | 561 // let array = []; |
562 Variable* array; | 562 Variable* array; |
563 { | 563 { |
564 auto empty_exprs = new (zone()) ZoneList<Expression*>(0, zone()); | 564 auto empty_exprs = new (zone()) ZoneList<Expression*>(0, zone()); |
565 array = CreateTempVar(factory()->NewArrayLiteral( | 565 array = CreateTempVar( |
566 empty_exprs, | 566 factory()->NewArrayLiteral(empty_exprs, kNoSourcePosition)); |
567 // Reuse pattern's literal index - it is unused since there is no | |
568 // actual literal allocated. | |
569 node->literal_index(), kNoSourcePosition)); | |
570 } | 567 } |
571 | 568 |
572 // done = true; | 569 // done = true; |
573 Statement* set_done = factory()->NewExpressionStatement( | 570 Statement* set_done = factory()->NewExpressionStatement( |
574 factory()->NewAssignment( | 571 factory()->NewAssignment( |
575 Token::ASSIGN, factory()->NewVariableProxy(done), | 572 Token::ASSIGN, factory()->NewVariableProxy(done), |
576 factory()->NewBooleanLiteral(true, nopos), nopos), | 573 factory()->NewBooleanLiteral(true, nopos), nopos), |
577 nopos); | 574 nopos); |
578 | 575 |
579 // result = IteratorNext(iterator); | 576 // result = IteratorNext(iterator); |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 NOT_A_PATTERN(TryFinallyStatement) | 746 NOT_A_PATTERN(TryFinallyStatement) |
750 NOT_A_PATTERN(UnaryOperation) | 747 NOT_A_PATTERN(UnaryOperation) |
751 NOT_A_PATTERN(VariableDeclaration) | 748 NOT_A_PATTERN(VariableDeclaration) |
752 NOT_A_PATTERN(WhileStatement) | 749 NOT_A_PATTERN(WhileStatement) |
753 NOT_A_PATTERN(WithStatement) | 750 NOT_A_PATTERN(WithStatement) |
754 NOT_A_PATTERN(Yield) | 751 NOT_A_PATTERN(Yield) |
755 | 752 |
756 #undef NOT_A_PATTERN | 753 #undef NOT_A_PATTERN |
757 } // namespace internal | 754 } // namespace internal |
758 } // namespace v8 | 755 } // namespace v8 |
OLD | NEW |