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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 } | 244 } |
245 | 245 |
246 | 246 |
247 void Parser::PatternRewriter::VisitArrayLiteral(ArrayLiteral* node) { | 247 void Parser::PatternRewriter::VisitArrayLiteral(ArrayLiteral* node) { |
248 auto temp = CreateTempVar(current_value_); | 248 auto temp = CreateTempVar(current_value_); |
249 | 249 |
250 block_->statements()->Add(descriptor_->parser->BuildAssertIsCoercible(temp), | 250 block_->statements()->Add(descriptor_->parser->BuildAssertIsCoercible(temp), |
251 zone()); | 251 zone()); |
252 | 252 |
253 auto iterator = CreateTempVar(descriptor_->parser->GetIterator( | 253 auto iterator = CreateTempVar(descriptor_->parser->GetIterator( |
254 factory()->NewVariableProxy(temp), factory())); | 254 factory()->NewVariableProxy(temp), factory(), RelocInfo::kNoPosition)); |
255 auto done = CreateTempVar( | 255 auto done = CreateTempVar( |
256 factory()->NewBooleanLiteral(false, RelocInfo::kNoPosition)); | 256 factory()->NewBooleanLiteral(false, RelocInfo::kNoPosition)); |
257 auto result = CreateTempVar(); | 257 auto result = CreateTempVar(); |
258 auto v = CreateTempVar(); | 258 auto v = CreateTempVar(); |
259 | 259 |
260 Spread* spread = nullptr; | 260 Spread* spread = nullptr; |
261 for (Expression* value : *node->values()) { | 261 for (Expression* value : *node->values()) { |
262 if (value->IsSpread()) { | 262 if (value->IsSpread()) { |
263 spread = value->AsSpread(); | 263 spread = value->AsSpread(); |
264 break; | 264 break; |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 NOT_A_PATTERN(TryFinallyStatement) | 426 NOT_A_PATTERN(TryFinallyStatement) |
427 NOT_A_PATTERN(UnaryOperation) | 427 NOT_A_PATTERN(UnaryOperation) |
428 NOT_A_PATTERN(VariableDeclaration) | 428 NOT_A_PATTERN(VariableDeclaration) |
429 NOT_A_PATTERN(WhileStatement) | 429 NOT_A_PATTERN(WhileStatement) |
430 NOT_A_PATTERN(WithStatement) | 430 NOT_A_PATTERN(WithStatement) |
431 NOT_A_PATTERN(Yield) | 431 NOT_A_PATTERN(Yield) |
432 | 432 |
433 #undef NOT_A_PATTERN | 433 #undef NOT_A_PATTERN |
434 } // namespace internal | 434 } // namespace internal |
435 } // namespace v8 | 435 } // namespace v8 |
OLD | NEW |