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

Unified Diff: src/ast/scopes.cc

Issue 2351823005: Only create ScopeInfos for scopes that really need one (Closed)
Patch Set: updates Created 4 years, 3 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 86f87b15f26d575f9929752c1625978f0f9db78a..ced29e8c50b6495800edc8b240843ba83b82907a 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -1046,6 +1046,13 @@ void DeclarationScope::AllocateVariables(ParseInfo* info, AnalyzeMode mode) {
break;
}
AllocateScopeInfosRecursively(info->isolate(), mode, outer_scope);
+ // The debugger expects all shared function infos to contain a scope info.
+ // Since the top-most scope will end up in a shared function info, make sure
+ // it has one, even if it doesn't need a scope info.
+ // TODO(jochen|yangguo): Remove this requirement.
+ if (scope_info_.is_null()) {
+ scope_info_ = ScopeInfo::Create(info->isolate(), zone(), this, outer_scope);
+ }
}
bool Scope::AllowsLazyParsing() const {
« 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