Index: src/debug/debug-scopes.cc |
diff --git a/src/debug/debug-scopes.cc b/src/debug/debug-scopes.cc |
index 27ee5e79ce4fbec8e69048dcf7f86c008a84af8a..1807bde9ed95fa2165c0c995007b2951f98d9039 100644 |
--- a/src/debug/debug-scopes.cc |
+++ b/src/debug/debug-scopes.cc |
@@ -214,7 +214,7 @@ ScopeIterator::ScopeType ScopeIterator::Type() { |
DCHECK(context_->IsScriptContext() || context_->IsNativeContext()); |
return ScopeTypeScript; |
case WITH_SCOPE: |
- DCHECK(context_->IsWithContext()); |
+ DCHECK(context_->IsWithContext() || context_->IsDebugEvaluateContext()); |
return ScopeTypeWith; |
case CATCH_SCOPE: |
DCHECK(context_->IsCatchContext()); |
@@ -247,7 +247,7 @@ ScopeIterator::ScopeType ScopeIterator::Type() { |
if (context_->IsScriptContext()) { |
return ScopeTypeScript; |
} |
- DCHECK(context_->IsWithContext()); |
+ DCHECK(context_->IsWithContext() || context_->IsDebugEvaluateContext()); |
return ScopeTypeWith; |
} |
@@ -344,16 +344,18 @@ Handle<Context> ScopeIterator::CurrentContext() { |
} |
} |
- |
-void ScopeIterator::GetNonLocals(List<Handle<String> >* list_out) { |
+Handle<NameDictionary> ScopeIterator::GetNonLocals() { |
Handle<String> this_string = isolate_->factory()->this_string(); |
+ Handle<NameDictionary> dict = |
+ NameDictionary::New(isolate_, non_locals_->occupancy()); |
for (HashMap::Entry* entry = non_locals_->Start(); entry != nullptr; |
entry = non_locals_->Next(entry)) { |
Handle<String> name(reinterpret_cast<String**>(entry->key)); |
// We need to treat "this" differently. |
if (name.is_identical_to(this_string)) continue; |
- list_out->Add(Handle<String>(reinterpret_cast<String**>(entry->key))); |
+ dict = NameDictionary::Add(dict, name, name, PropertyDetails::Empty()); |
} |
+ return dict; |
} |