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

Unified Diff: src/ast/scopes.cc

Issue 1500933002: [debugger] fix debug-evaluate wrt shadowed context var. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add TODO Created 5 years 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
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index cf5dd29b66ed448d6c59891996749a08eed92eb2..42f7972742c1a8f0b5113759c6b1993c48595cda 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -842,6 +842,24 @@ void Scope::GetNestedScopeChain(Isolate* isolate,
}
+void Scope::CollectNonLocals(HashMap* non_locals) {
+ // Collect non-local variables referenced in the scope.
+ // TODO(yangguo): store non-local variables explicitly if we can no longer
+ // rely on unresolved_ to find them.
+ for (int i = 0; i < unresolved_.length(); i++) {
+ VariableProxy* proxy = unresolved_[i];
+ if (proxy->is_resolved() && proxy->var()->IsStackAllocated()) continue;
+ Handle<String> name = proxy->name();
+ void* key = reinterpret_cast<void*>(name.location());
+ HashMap::Entry* entry = non_locals->LookupOrInsert(key, name->Hash());
+ entry->value = key;
+ }
+ for (int i = 0; i < inner_scopes_.length(); i++) {
+ inner_scopes_[i]->CollectNonLocals(non_locals);
+ }
+}
+
+
void Scope::ReportMessage(int start_position, int end_position,
MessageTemplate::Template message,
const AstRawString* arg) {
« src/ast/scopes.h ('K') | « src/ast/scopes.h ('k') | src/debug/debug-evaluate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698