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

Unified Diff: src/api.cc

Issue 377213002: Add FunctionTemplate::GetClassName to API. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 | « include/v8.h ('k') | test/cctest/test-api.cc » ('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 8238922453bfb48130955ebbf8eb8c63e5e72b36..b9678ba764bc53861b0672bd81d6c3e1da2485a9 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1243,6 +1243,20 @@ void FunctionTemplate::SetClassName(Handle<String> name) {
}
+Local<String> FunctionTemplate::GetClassName() {
+ i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
+ ENTER_V8(isolate);
+ EscapableHandleScope scope(reinterpret_cast<Isolate*>(isolate));
Yang 2014/07/09 11:41:50 Not sure whether we really need the handle scope t
aandrey 2014/07/09 11:46:24 Removed.
+ i::Handle<i::FunctionTemplateInfo> self = Utils::OpenHandle(this);
+ i::Handle<i::Object> name(self->class_name(), isolate);
+ if (name->IsString()) {
+ return scope.Escape(Utils::ToLocal(i::Handle<i::String>::cast(name)));
+ } else {
+ return Local<String>();
+ }
+}
+
+
void FunctionTemplate::SetHiddenPrototype(bool value) {
i::Isolate* isolate = Utils::OpenHandle(this)->GetIsolate();
ENTER_V8(isolate);
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698