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

Side by Side Diff: src/preparser.h

Issue 1129083009: [destructuring] Support computed property names in patterns. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Patch for landing Created 5 years, 7 months 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/pattern-rewriter.cc ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 #ifndef V8_PREPARSER_H 5 #ifndef V8_PREPARSER_H
6 #define V8_PREPARSER_H 6 #define V8_PREPARSER_H
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 2538 matching lines...) Expand 10 before | Expand all | Expand 10 after
2549 2549
2550 case Token::NUMBER: 2550 case Token::NUMBER:
2551 Consume(Token::NUMBER); 2551 Consume(Token::NUMBER);
2552 *name = this->GetNumberAsSymbol(scanner()); 2552 *name = this->GetNumberAsSymbol(scanner());
2553 break; 2553 break;
2554 2554
2555 case Token::LBRACK: 2555 case Token::LBRACK:
2556 if (allow_harmony_computed_property_names_) { 2556 if (allow_harmony_computed_property_names_) {
2557 *is_computed_name = true; 2557 *is_computed_name = true;
2558 Consume(Token::LBRACK); 2558 Consume(Token::LBRACK);
2559 ExpressionT expression = 2559 ExpressionClassifier computed_name_classifier;
2560 ParseAssignmentExpression(true, classifier, CHECK_OK); 2560 ExpressionT expression = ParseAssignmentExpression(
2561 true, &computed_name_classifier, CHECK_OK);
2562 classifier->AccumulateReclassifyingAsPattern(computed_name_classifier);
2561 Expect(Token::RBRACK, CHECK_OK); 2563 Expect(Token::RBRACK, CHECK_OK);
2562 return expression; 2564 return expression;
2563 } 2565 }
2564 2566
2565 // Fall through. 2567 // Fall through.
2566 case Token::STATIC: 2568 case Token::STATIC:
2567 *is_static = true; 2569 *is_static = true;
2568 2570
2569 // Fall through. 2571 // Fall through.
2570 default: 2572 default:
(...skipping 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after
4001 *ok = false; 4003 *ok = false;
4002 return; 4004 return;
4003 } 4005 }
4004 has_seen_constructor_ = true; 4006 has_seen_constructor_ = true;
4005 return; 4007 return;
4006 } 4008 }
4007 } 4009 }
4008 } } // v8::internal 4010 } } // v8::internal
4009 4011
4010 #endif // V8_PREPARSER_H 4012 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « src/pattern-rewriter.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698