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

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

Issue 2751573003: [debugger] correctly find inner function scope. (Closed)
Patch Set: Created 3 years, 9 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/inspector/debugger/step-into-nested-arrow.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 c5beb7cfe8c4701946014f5807ad5a456280d201..cf957bc1eccaff4fe1c0587197126dac13b59be3 100644
--- a/src/debug/debug-scopes.cc
+++ b/src/debug/debug-scopes.cc
@@ -838,8 +838,12 @@ 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.
+ // Nested arrow functions could have the same end positions.
Handle<JSFunction> function = frame_inspector_->GetFunction();
- if (scope->end_position() < function->shared()->end_position()) return;
+ if (scope->start_position() > function->shared()->start_position() &&
+ 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
« no previous file with comments | « no previous file | test/inspector/debugger/step-into-nested-arrow.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698