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: |