Index: src/ast/scopes.cc |
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc |
index d7decb04bf01d96bd7c1b052232af5d39094babd..b197cb6990f79b9f713b68c9b84668c9d74e22a2 100644 |
--- a/src/ast/scopes.cc |
+++ b/src/ast/scopes.cc |
@@ -1087,11 +1087,8 @@ void DeclarationScope::AllocateVariables(ParseInfo* info, AnalyzeMode mode) { |
AllocateVariablesRecursively(); |
MaybeHandle<ScopeInfo> outer_scope; |
- for (const Scope* s = outer_scope_; s != nullptr; s = s->outer_scope_) { |
- if (s->scope_info_.is_null()) continue; |
- outer_scope = s->scope_info_; |
- break; |
- } |
+ if (outer_scope_ != nullptr) outer_scope = outer_scope_->scope_info_; |
jochen (gone - plz use gerrit)
2016/10/17 09:55:51
DCHECK that scope_info_ is not null?
Toon Verwaest
2016/10/17 10:34:37
That scope info isn't guaranteed to be non-null. W
|
+ |
AllocateScopeInfosRecursively(info->isolate(), outer_scope); |
if (mode == AnalyzeMode::kDebugger) { |
AllocateDebuggerScopeInfos(info->isolate(), outer_scope); |