Chromium Code Reviews| 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); |