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

Unified Diff: src/api.cc

Issue 1449473005: [V8] Unify get function name for debugging purpose (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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 | « include/v8.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/api.cc
diff --git a/src/api.cc b/src/api.cc
index 5d4c9c0c415ac558747dfa55b25b19a02c9187b4..b60c4ef0132dbe7cf7c5ea68a764c39c2ec60e65 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -4443,6 +4443,18 @@ Local<Value> Function::GetInferredName() const {
}
+Local<Value> Function::GetDebugName() const {
+ auto self = Utils::OpenHandle(this);
+ if (!self->IsJSFunction()) {
+ return ToApiHandle<Primitive>(
+ self->GetIsolate()->factory()->undefined_value());
+ }
+ auto func = i::Handle<i::JSFunction>::cast(self);
+ i::Handle<i::String> name = i::JSFunction::GetDebugName(func);
+ return Utils::ToLocal(i::Handle<i::Object>(*name, name->GetIsolate()));
+}
+
+
Local<Value> Function::GetDisplayName() const {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
ENTER_V8(isolate);
« no previous file with comments | « include/v8.h ('k') | src/debug/mirrors.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698