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

Unified Diff: src/ast/scopes.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, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/scopes.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index 6110b43544b34b99cf608fb9404743faeb003b09..95ab56a46c20978bcb8fc0c204c369b9c0d92623 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -141,7 +141,7 @@
zone_(zone) {
SetDefaults(CATCH_SCOPE, NULL, Handle<ScopeInfo>::null());
AddInnerScope(inner_scope);
- ++num_var_;
+ ++num_var_or_const_;
num_heap_slots_ = Context::MIN_CONTEXT_SLOTS;
Variable* variable = variables_.Declare(this,
catch_variable_name,
@@ -185,7 +185,7 @@
force_eager_compilation_ = false;
force_context_allocation_ = (outer_scope != NULL && !is_function_scope())
? outer_scope->has_forced_context_allocation() : false;
- num_var_ = 0;
+ num_var_or_const_ = 0;
num_stack_slots_ = 0;
num_heap_slots_ = 0;
num_global_slots_ = 0;
@@ -339,7 +339,8 @@
DCHECK(temps_.is_empty());
DCHECK(params_.is_empty());
- if (num_var() > 0 || (is_declaration_scope() && calls_sloppy_eval())) {
+ if (num_var_or_const() > 0 ||
+ (is_declaration_scope() && calls_sloppy_eval())) {
return this;
}
@@ -511,7 +512,7 @@
// introduced during variable allocation, and TEMPORARY variables are
// allocated via NewTemporary().
DCHECK(IsDeclaredVariableMode(mode));
- ++num_var_;
+ ++num_var_or_const_;
return variables_.Declare(this, name, mode, kind, init_flag,
maybe_assigned_flag);
}
@@ -610,25 +611,6 @@
return NULL;
}
-Declaration* Scope::CheckLexDeclarationsConflictingWith(
- ZoneList<const AstRawString*>* names) {
- int length = names->length();
- for (int i = 0; i < length; ++i) {
- Variable* var = LookupLocal(names->at(i));
- if (var != nullptr && IsLexicalVariableMode(var->mode())) {
- // Conflict; find and return its declaration.
- const AstRawString* name = names->at(i);
- int decls_length = decls_.length();
- for (int j = 0; j < decls_length; ++j) {
- if (decls_[i]->proxy()->raw_name() == name) {
- return decls_[i];
- }
- }
- DCHECK(false);
- }
- }
- return nullptr;
-}
class VarAndOrder {
public:
« no previous file with comments | « src/ast/scopes.h ('k') | src/parsing/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698