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

Side by Side Diff: src/preparser.h

Issue 1401253003: Check for let in lexically bound names for short object literals (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | test/message/let-lexical-name-in-object-prohibited.js » ('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/bailout-reason.h" 8 #include "src/bailout-reason.h"
9 #include "src/expression-classifier.h" 9 #include "src/expression-classifier.h"
10 #include "src/func-name-inferrer.h" 10 #include "src/func-name-inferrer.h"
(...skipping 2630 matching lines...) Expand 10 before | Expand all | Expand 10 after
2641 // PropertyDefinition 2641 // PropertyDefinition
2642 // IdentifierReference 2642 // IdentifierReference
2643 // CoverInitializedName 2643 // CoverInitializedName
2644 // 2644 //
2645 // CoverInitializedName 2645 // CoverInitializedName
2646 // IdentifierReference Initializer? 2646 // IdentifierReference Initializer?
2647 if (classifier->duplicate_finder() != nullptr && 2647 if (classifier->duplicate_finder() != nullptr &&
2648 scanner()->FindSymbol(classifier->duplicate_finder(), 1) != 0) { 2648 scanner()->FindSymbol(classifier->duplicate_finder(), 1) != 0) {
2649 classifier->RecordDuplicateFormalParameterError(scanner()->location()); 2649 classifier->RecordDuplicateFormalParameterError(scanner()->location());
2650 } 2650 }
2651 if (name_token == Token::LET) {
2652 classifier->RecordLetPatternError(
2653 scanner()->location(), MessageTemplate::kLetInLexicalBinding);
2654 }
2651 2655
2652 ExpressionT lhs = this->ExpressionFromIdentifier( 2656 ExpressionT lhs = this->ExpressionFromIdentifier(
2653 name, next_beg_pos, next_end_pos, scope_, factory()); 2657 name, next_beg_pos, next_end_pos, scope_, factory());
2654 2658
2655 if (peek() == Token::ASSIGN) { 2659 if (peek() == Token::ASSIGN) {
2656 this->ExpressionUnexpectedToken(classifier); 2660 this->ExpressionUnexpectedToken(classifier);
2657 Consume(Token::ASSIGN); 2661 Consume(Token::ASSIGN);
2658 ExpressionClassifier rhs_classifier; 2662 ExpressionClassifier rhs_classifier;
2659 ExpressionT rhs = this->ParseAssignmentExpression( 2663 ExpressionT rhs = this->ParseAssignmentExpression(
2660 true, &rhs_classifier, CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); 2664 true, &rhs_classifier, CHECK_OK_CUSTOM(EmptyObjectLiteralProperty));
(...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after
4186 return; 4190 return;
4187 } 4191 }
4188 has_seen_constructor_ = true; 4192 has_seen_constructor_ = true;
4189 return; 4193 return;
4190 } 4194 }
4191 } 4195 }
4192 } // namespace internal 4196 } // namespace internal
4193 } // namespace v8 4197 } // namespace v8
4194 4198
4195 #endif // V8_PREPARSER_H 4199 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « no previous file | test/message/let-lexical-name-in-object-prohibited.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698