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/parsing/parameter-initializer-rewriter.h" | 7 #include "src/parsing/parameter-initializer-rewriter.h" |
8 #include "src/parsing/parser.h" | 8 #include "src/parsing/parser.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 VisitObjectLiteral(node, &temp_var); | 367 VisitObjectLiteral(node, &temp_var); |
368 } | 368 } |
369 | 369 |
370 | 370 |
371 void Parser::PatternRewriter::VisitArrayLiteral(ArrayLiteral* node, | 371 void Parser::PatternRewriter::VisitArrayLiteral(ArrayLiteral* node, |
372 Variable** temp_var) { | 372 Variable** temp_var) { |
373 DCHECK(block_->ignore_completion_value()); | 373 DCHECK(block_->ignore_completion_value()); |
374 | 374 |
375 auto temp = *temp_var = CreateTempVar(current_value_); | 375 auto temp = *temp_var = CreateTempVar(current_value_); |
376 auto iterator = CreateTempVar(parser_->GetIterator( | 376 auto iterator = CreateTempVar(parser_->GetIterator( |
377 factory()->NewVariableProxy(temp), factory(), kNoSourcePosition)); | 377 factory()->NewVariableProxy(temp), kNoSourcePosition)); |
378 auto done = | 378 auto done = |
379 CreateTempVar(factory()->NewBooleanLiteral(false, kNoSourcePosition)); | 379 CreateTempVar(factory()->NewBooleanLiteral(false, kNoSourcePosition)); |
380 auto result = CreateTempVar(); | 380 auto result = CreateTempVar(); |
381 auto v = CreateTempVar(); | 381 auto v = CreateTempVar(); |
382 auto completion = CreateTempVar(); | 382 auto completion = CreateTempVar(); |
383 auto nopos = kNoSourcePosition; | 383 auto nopos = kNoSourcePosition; |
384 | 384 |
385 // For the purpose of iterator finalization, we temporarily set block_ to a | 385 // For the purpose of iterator finalization, we temporarily set block_ to a |
386 // new block. In the main body of this function, we write to block_ (both | 386 // new block. In the main body of this function, we write to block_ (both |
387 // explicitly and implicitly via recursion). At the end of the function, we | 387 // explicitly and implicitly via recursion). At the end of the function, we |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 NOT_A_PATTERN(TryFinallyStatement) | 702 NOT_A_PATTERN(TryFinallyStatement) |
703 NOT_A_PATTERN(UnaryOperation) | 703 NOT_A_PATTERN(UnaryOperation) |
704 NOT_A_PATTERN(VariableDeclaration) | 704 NOT_A_PATTERN(VariableDeclaration) |
705 NOT_A_PATTERN(WhileStatement) | 705 NOT_A_PATTERN(WhileStatement) |
706 NOT_A_PATTERN(WithStatement) | 706 NOT_A_PATTERN(WithStatement) |
707 NOT_A_PATTERN(Yield) | 707 NOT_A_PATTERN(Yield) |
708 | 708 |
709 #undef NOT_A_PATTERN | 709 #undef NOT_A_PATTERN |
710 } // namespace internal | 710 } // namespace internal |
711 } // namespace v8 | 711 } // namespace v8 |
OLD | NEW |