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

Unified Diff: src/ast/scopes.cc

Issue 2322243002: Preparse inner functions. (Closed)
Patch Set: fixes Created 4 years, 1 month 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/flag-definitions.h » ('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 d45b02091cd805d1b0e5ec8fad07f651cac2ca7b..e4ac5d5b54c372e7b57ff3384c42a94bd5bad63e 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -1045,12 +1045,14 @@ void DeclarationScope::AllocateVariables(ParseInfo* info, AnalyzeMode mode) {
AllocateScopeInfosRecursively(info->isolate(), mode, outer_scope);
}
-bool Scope::AllowsLazyParsing() const {
- // If we are inside a block scope, we must parse eagerly to find out how
- // to allocate variables on the block scope. At this point, declarations may
- // not have yet been parsed.
+bool Scope::AllowsLazyParsingWithoutUnresolvedVariables() const {
+ // If we are inside a block scope, we must find unresolved variables in the
+ // inner scopes to find out how to allocate variables on the block scope. At
+ // this point, declarations may not have yet been parsed.
for (const Scope* s = this; s != nullptr; s = s->outer_scope_) {
if (s->is_block_scope()) return false;
+ // TODO(marja): Refactor parsing modes: also add s->is_function_scope()
+ // here.
}
return true;
}
« no previous file with comments | « src/ast/scopes.h ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698