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

Unified Diff: src/ast/scopes.cc

Issue 2608333003: PreParsing inner funcs: Do fewer variable name lookups. (Closed)
Patch Set: code review (jochen@) Created 3 years, 11 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') | no next file » | 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 40c2648befadd946bba6b4b58ec6f6cd59b0fbfa..5e29af727d24fc7a624de948d05671c00a17674a 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -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_.DeclareName(zone(), name);
}
VariableProxy* Scope::NewUnresolved(AstNodeFactory* factory,
« no previous file with comments | « src/ast/scopes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698