| 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 564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 { | 575 { |
| 576 ExpressionClassifier pattern_classifier; | 576 ExpressionClassifier pattern_classifier; |
| 577 Token::Value next = peek(); | 577 Token::Value next = peek(); |
| 578 pattern = ParsePrimaryExpression(&pattern_classifier, CHECK_OK); | 578 pattern = ParsePrimaryExpression(&pattern_classifier, CHECK_OK); |
| 579 | 579 |
| 580 ValidateBindingPattern(&pattern_classifier, CHECK_OK); | 580 ValidateBindingPattern(&pattern_classifier, CHECK_OK); |
| 581 if (lexical) { | 581 if (lexical) { |
| 582 ValidateLetPattern(&pattern_classifier, CHECK_OK); | 582 ValidateLetPattern(&pattern_classifier, CHECK_OK); |
| 583 } | 583 } |
| 584 | 584 |
| 585 if (!allow_harmony_destructuring() && !pattern.IsIdentifier()) { | 585 if (!allow_harmony_destructuring_bind() && !pattern.IsIdentifier()) { |
| 586 ReportUnexpectedToken(next); | 586 ReportUnexpectedToken(next); |
| 587 *ok = false; | 587 *ok = false; |
| 588 return Statement::Default(); | 588 return Statement::Default(); |
| 589 } | 589 } |
| 590 } | 590 } |
| 591 | 591 |
| 592 bool is_pattern = pattern.IsObjectLiteral() || pattern.IsArrayLiteral(); | 592 bool is_pattern = pattern.IsObjectLiteral() || pattern.IsArrayLiteral(); |
| 593 | 593 |
| 594 bool is_for_iteration_variable = | 594 bool is_for_iteration_variable = |
| 595 var_context == kForStatement && | 595 var_context == kForStatement && |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1260 Expect(Token::RBRACE, CHECK_OK); | 1260 Expect(Token::RBRACE, CHECK_OK); |
| 1261 return PreParserExpression::Default(); | 1261 return PreParserExpression::Default(); |
| 1262 } | 1262 } |
| 1263 } | 1263 } |
| 1264 | 1264 |
| 1265 #undef CHECK_OK | 1265 #undef CHECK_OK |
| 1266 | 1266 |
| 1267 | 1267 |
| 1268 } // namespace internal | 1268 } // namespace internal |
| 1269 } // namespace v8 | 1269 } // namespace v8 |
| OLD | NEW |