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

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

Issue 1375813002: [V8] Add name of function for function's closure scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 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 | « src/debug/debug-scopes.h ('k') | src/debug/mirrors.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 e8ef2403934dc06f795a989897c49fa10144d412..47b902bd59fed2afff345355a8ff2cefb2a433cc 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() != NULL) {
+ Handle<String> closure_name = JSFunction::GetDebugName(
+ Handle<JSFunction>(CurrentContext()->closure()));
+ if (!closure_name.is_null() && (closure_name->length() != 0))
+ details->set(kScopeDetailsNameIndex, *closure_name);
+ }
return isolate_->factory()->NewJSArrayWithElements(details);
}
« no previous file with comments | « src/debug/debug-scopes.h ('k') | src/debug/mirrors.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698