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

Unified Diff: src/debug/debug-scopes.cc

Issue 2185913003: [debugger] Scope iterator should not visit inner function literals. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | test/mjsunit/regress/regress-crbug-621361.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug/debug-scopes.cc
diff --git a/src/debug/debug-scopes.cc b/src/debug/debug-scopes.cc
index 0acecaf853393c8cb5c2b40769c7115553c9bc57..ce9cac2046cd2c7879959c7b9831ed13763773ed 100644
--- a/src/debug/debug-scopes.cc
+++ b/src/debug/debug-scopes.cc
@@ -792,6 +792,11 @@ void ScopeIterator::CopyContextExtensionToScopeObject(
void ScopeIterator::GetNestedScopeChain(Isolate* isolate, Scope* scope,
int position) {
+ if (scope->is_function_scope()) {
+ // Do not collect scopes of nested inner functions inside the current one.
+ Handle<JSFunction> function = frame_inspector_->GetFunction();
+ if (scope->end_position() < function->shared()->end_position()) return;
+ }
if (scope->is_hidden()) {
// We need to add this chain element in case the scope has a context
// associated. We need to keep the scope chain and context chain in sync.
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-621361.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698