Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Side by Side Diff: src/preparser.cc

Issue 1450193002: Rename destructuring flag to "--harmony-destructuring-bind" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/preparser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/preparser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698