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

Side by Side Diff: src/parsing/parser.cc

Issue 2365693004: Refine duplicate arrow function parameter location handling (Closed)
Patch Set: Make MSVC happy Created 4 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 | « src/parsing/expression-classifier.h ('k') | no next file » | 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 #include "src/parsing/parser.h" 5 #include "src/parsing/parser.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "src/api.h" 9 #include "src/api.h"
10 #include "src/ast/ast-expression-rewriter.h" 10 #include "src/ast/ast-expression-rewriter.h"
(...skipping 2591 matching lines...) Expand 10 before | Expand all | Expand 10 after
2602 return; 2602 return;
2603 } 2603 }
2604 2604
2605 ExpressionClassifier classifier(this); 2605 ExpressionClassifier classifier(this);
2606 if (!parameters->is_simple) { 2606 if (!parameters->is_simple) {
2607 this->classifier()->RecordNonSimpleParameter(); 2607 this->classifier()->RecordNonSimpleParameter();
2608 } 2608 }
2609 for (int i = 0; i < parameters->Arity(); ++i) { 2609 for (int i = 0; i < parameters->Arity(); ++i) {
2610 auto parameter = parameters->at(i); 2610 auto parameter = parameters->at(i);
2611 DeclareFormalParameter(parameters->scope, parameter); 2611 DeclareFormalParameter(parameters->scope, parameter);
2612 if (!duplicate_loc->IsValid()) { 2612 if (!this->classifier()
2613 ->is_valid_formal_parameter_list_without_duplicates() &&
2614 !duplicate_loc->IsValid()) {
2613 *duplicate_loc = 2615 *duplicate_loc =
2614 this->classifier()->duplicate_formal_parameter_error().location; 2616 this->classifier()->duplicate_formal_parameter_error().location;
2615 } 2617 }
2616 } 2618 }
2617 DCHECK_EQ(parameters->is_simple, parameters->scope->has_simple_parameters()); 2619 DCHECK_EQ(parameters->is_simple, parameters->scope->has_simple_parameters());
2618 } 2620 }
2619 2621
2620 void Parser::ReindexLiterals(const ParserFormalParameters& parameters) { 2622 void Parser::ReindexLiterals(const ParserFormalParameters& parameters) {
2621 if (function_state_->materialized_literal_count() > 0) { 2623 if (function_state_->materialized_literal_count() > 0) {
2622 AstLiteralReindexer reindexer; 2624 AstLiteralReindexer reindexer;
(...skipping 2982 matching lines...) Expand 10 before | Expand all | Expand 10 after
5605 5607
5606 return final_loop; 5608 return final_loop;
5607 } 5609 }
5608 5610
5609 #undef CHECK_OK 5611 #undef CHECK_OK
5610 #undef CHECK_OK_VOID 5612 #undef CHECK_OK_VOID
5611 #undef CHECK_FAILED 5613 #undef CHECK_FAILED
5612 5614
5613 } // namespace internal 5615 } // namespace internal
5614 } // namespace v8 5616 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/expression-classifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698