Index: src/ast/scopes.cc |
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc |
index 40c2648befadd946bba6b4b58ec6f6cd59b0fbfa..370569c1c82a3caf048fff0e5b45a0733f5f768f 100644 |
--- a/src/ast/scopes.cc |
+++ b/src/ast/scopes.cc |
@@ -53,7 +53,7 @@ Variable* VariableMap::Declare(Zone* zone, Scope* scope, |
return reinterpret_cast<Variable*>(p->value); |
} |
-void VariableMap::DeclareName(Zone* zone, const AstRawString* name) { |
+void VariableMap::LookupOrDeclareName(Zone* zone, const AstRawString* name) { |
jochen (gone - plz use gerrit)
2017/01/04 10:51:13
LookupOrDeclare sounds strange, as the method does
marja
2017/01/04 11:31:45
Done.
|
Entry* p = |
ZoneHashMap::LookupOrInsert(const_cast<AstRawString*>(name), name->hash(), |
ZoneAllocationPolicy(zone)); |
@@ -1037,11 +1037,10 @@ void Scope::DeclareVariableName(const AstRawString* name, VariableMode mode) { |
DCHECK(!is_eval_scope()); |
DCHECK(is_declaration_scope() || |
(IsLexicalVariableMode(mode) && is_block_scope())); |
+ DCHECK(scope_info_.is_null()); |
// Declare the variable in the declaration scope. |
- if (LookupLocal(name) == nullptr) { |
- variables_.DeclareName(zone(), name); |
- } |
+ variables_.LookupOrDeclareName(zone(), name); |
} |
VariableProxy* Scope::NewUnresolved(AstNodeFactory* factory, |