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

Unified Diff: src/ast/scopes.h

Issue 2287783003: Revert of Always deserialize scope infos for parsing (Closed)
Patch Set: Created 4 years, 4 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/scopeinfo.cc ('k') | src/ast/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.h
diff --git a/src/ast/scopes.h b/src/ast/scopes.h
index 561a7fce06f8fcf32715040f605681bfd47d3f4b..8a84664c18ec44d657ebc85db9208c98d3b66c5f 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -124,8 +124,12 @@
// Lookup a variable in this scope. Returns the variable or NULL if not found.
Variable* LookupLocal(const AstRawString* name) {
- return variables_.Lookup(name);
- }
+ Variable* result = variables_.Lookup(name);
+ if (result != nullptr || scope_info_.is_null()) return result;
+ return LookupInScopeInfo(name);
+ }
+
+ Variable* LookupInScopeInfo(const AstRawString* name);
// Lookup a variable in this scope or outer scopes.
// Returns the variable or NULL if not found.
« no previous file with comments | « src/ast/scopeinfo.cc ('k') | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698