OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 <cmath> | 5 #include <cmath> |
6 | 6 |
7 #include "src/allocation.h" | 7 #include "src/allocation.h" |
8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
9 #include "src/conversions-inl.h" | 9 #include "src/conversions-inl.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 do { | 542 do { |
543 // Parse binding pattern. | 543 // Parse binding pattern. |
544 if (nvars > 0) Consume(Token::COMMA); | 544 if (nvars > 0) Consume(Token::COMMA); |
545 { | 545 { |
546 ExpressionClassifier pattern_classifier; | 546 ExpressionClassifier pattern_classifier; |
547 Token::Value next = peek(); | 547 Token::Value next = peek(); |
548 PreParserExpression pattern = | 548 PreParserExpression pattern = |
549 ParsePrimaryExpression(&pattern_classifier, CHECK_OK); | 549 ParsePrimaryExpression(&pattern_classifier, CHECK_OK); |
550 ValidateBindingPattern(&pattern_classifier, CHECK_OK); | 550 ValidateBindingPattern(&pattern_classifier, CHECK_OK); |
551 | 551 |
552 if (!FLAG_harmony_destructuring && !pattern.IsIdentifier()) { | 552 if (!allow_harmony_destructuring() && !pattern.IsIdentifier()) { |
553 ReportUnexpectedToken(next); | 553 ReportUnexpectedToken(next); |
554 *ok = false; | 554 *ok = false; |
555 return Statement::Default(); | 555 return Statement::Default(); |
556 } | 556 } |
557 } | 557 } |
558 | 558 |
559 Scanner::Location variable_loc = scanner()->location(); | 559 Scanner::Location variable_loc = scanner()->location(); |
560 nvars++; | 560 nvars++; |
561 if (peek() == Token::ASSIGN || require_initializer || | 561 if (peek() == Token::ASSIGN || require_initializer || |
562 // require initializers for multiple consts. | 562 // require initializers for multiple consts. |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1186 | 1186 |
1187 DCHECK(!spread_pos.IsValid()); | 1187 DCHECK(!spread_pos.IsValid()); |
1188 | 1188 |
1189 return Expression::Default(); | 1189 return Expression::Default(); |
1190 } | 1190 } |
1191 | 1191 |
1192 #undef CHECK_OK | 1192 #undef CHECK_OK |
1193 | 1193 |
1194 | 1194 |
1195 } } // v8::internal | 1195 } } // v8::internal |
OLD | NEW |