Index: src/pattern-rewriter.cc |
diff --git a/src/pattern-rewriter.cc b/src/pattern-rewriter.cc |
index 51cc33998da866d8293283dd1c3db68fc7365efe..1a85ff77e4a54b8ee494cd04ae6a9ab02df63bce 100644 |
--- a/src/pattern-rewriter.cc |
+++ b/src/pattern-rewriter.cc |
@@ -244,8 +244,13 @@ void Parser::PatternRewriter::VisitObjectLiteral(ObjectLiteral* pattern) { |
void Parser::PatternRewriter::VisitArrayLiteral(ArrayLiteral* node) { |
- auto iterator = CreateTempVar( |
- descriptor_->parser->GetIterator(current_value_, factory())); |
+ auto temp = CreateTempVar(current_value_); |
+ |
+ block_->statements()->Add(descriptor_->parser->BuildAssertIsCoercible(temp), |
+ zone()); |
+ |
+ auto iterator = CreateTempVar(descriptor_->parser->GetIterator( |
+ factory()->NewVariableProxy(temp), factory())); |
auto done = CreateTempVar( |
factory()->NewBooleanLiteral(false, RelocInfo::kNoPosition)); |
auto result = CreateTempVar(); |