Index: src/debug/debug-scopes.cc |
diff --git a/src/debug/debug-scopes.cc b/src/debug/debug-scopes.cc |
index e8ef2403934dc06f795a989897c49fa10144d412..e1f73aaec7639b1b5f633b20ed9e6840af5612a9 100644 |
--- a/src/debug/debug-scopes.cc |
+++ b/src/debug/debug-scopes.cc |
@@ -132,6 +132,12 @@ MUST_USE_RESULT MaybeHandle<JSObject> ScopeIterator::MaterializeScopeDetails() { |
Handle<JSObject> scope_object; |
ASSIGN_RETURN_ON_EXCEPTION(isolate_, scope_object, ScopeObject(), JSObject); |
details->set(kScopeDetailsObjectIndex, *scope_object); |
+ if (HasContext() && CurrentContext()->closure()) { |
+ Handle<String> closure_name = JSFunction::GetDebugName( |
+ Handle<JSFunction>(CurrentContext()->closure())); |
+ if (closure_name.location() && closure_name->length()) |
+ details->set(kScopeDetailsNameIndex, *closure_name); |
+ } |
return isolate_->factory()->NewJSArrayWithElements(details); |
} |