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

Side by Side Diff: src/parsing/pattern-rewriter.cc

Issue 2112223002: Revert of Add errors for declarations which conflict with catch parameters. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/parser.cc ('k') | test/mjsunit/es6/block-conflicts.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/ast/ast.h" 5 #include "src/ast/ast.h"
6 #include "src/messages.h" 6 #include "src/messages.h"
7 #include "src/parsing/parameter-initializer-rewriter.h" 7 #include "src/parsing/parameter-initializer-rewriter.h"
8 #include "src/parsing/parser.h" 8 #include "src/parsing/parser.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 if (!*ok_) return; 157 if (!*ok_) return;
158 DCHECK_NOT_NULL(var); 158 DCHECK_NOT_NULL(var);
159 DCHECK(!proxy->is_resolved() || proxy->var() == var); 159 DCHECK(!proxy->is_resolved() || proxy->var() == var);
160 var->set_initializer_position(initializer_position_); 160 var->set_initializer_position(initializer_position_);
161 161
162 DCHECK(initializer_position_ != kNoSourcePosition); 162 DCHECK(initializer_position_ != kNoSourcePosition);
163 163
164 Scope* declaration_scope = IsLexicalVariableMode(descriptor_->mode) 164 Scope* declaration_scope = IsLexicalVariableMode(descriptor_->mode)
165 ? descriptor_->scope 165 ? descriptor_->scope
166 : descriptor_->scope->DeclarationScope(); 166 : descriptor_->scope->DeclarationScope();
167 if (declaration_scope->num_var() > kMaxNumFunctionLocals) { 167 if (declaration_scope->num_var_or_const() > kMaxNumFunctionLocals) {
168 parser_->ReportMessage(MessageTemplate::kTooManyVariables); 168 parser_->ReportMessage(MessageTemplate::kTooManyVariables);
169 *ok_ = false; 169 *ok_ = false;
170 return; 170 return;
171 } 171 }
172 if (names_) { 172 if (names_) {
173 names_->Add(name, zone()); 173 names_->Add(name, zone());
174 } 174 }
175 175
176 // Initialize variables if needed. A 176 // Initialize variables if needed. A
177 // declaration of the form: 177 // declaration of the form:
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 NOT_A_PATTERN(TryFinallyStatement) 777 NOT_A_PATTERN(TryFinallyStatement)
778 NOT_A_PATTERN(UnaryOperation) 778 NOT_A_PATTERN(UnaryOperation)
779 NOT_A_PATTERN(VariableDeclaration) 779 NOT_A_PATTERN(VariableDeclaration)
780 NOT_A_PATTERN(WhileStatement) 780 NOT_A_PATTERN(WhileStatement)
781 NOT_A_PATTERN(WithStatement) 781 NOT_A_PATTERN(WithStatement)
782 NOT_A_PATTERN(Yield) 782 NOT_A_PATTERN(Yield)
783 783
784 #undef NOT_A_PATTERN 784 #undef NOT_A_PATTERN
785 } // namespace internal 785 } // namespace internal
786 } // namespace v8 786 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | test/mjsunit/es6/block-conflicts.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698