Index: gin/per_isolate_data.cc |
diff --git a/gin/per_isolate_data.cc b/gin/per_isolate_data.cc |
index 56b2c533fb08ca2c7ca86c2f6662a54f51801a89..b18a89ad9587dced684ce4d6b406d1ac45943b1d 100644 |
--- a/gin/per_isolate_data.cc |
+++ b/gin/per_isolate_data.cc |
@@ -9,6 +9,7 @@ using v8::Handle; |
using v8::Isolate; |
using v8::Local; |
using v8::Object; |
+using v8::FunctionTemplate; |
using v8::ObjectTemplate; |
namespace gin { |
@@ -30,6 +31,11 @@ void PerIsolateData::SetObjectTemplate(WrapperInfo* info, |
object_templates_[info] = Eternal<ObjectTemplate>(isolate_, templ); |
} |
+void PerIsolateData::SetFunctionTemplate(WrapperInfo* info, |
+ Local<FunctionTemplate> templ) { |
+ function_templates_[info] = Eternal<FunctionTemplate>(isolate_, templ); |
+} |
+ |
v8::Local<v8::ObjectTemplate> PerIsolateData::GetObjectTemplate( |
WrapperInfo* info) { |
ObjectTemplateMap::iterator it = object_templates_.find(info); |
@@ -38,4 +44,12 @@ v8::Local<v8::ObjectTemplate> PerIsolateData::GetObjectTemplate( |
return it->second.Get(isolate_); |
} |
+v8::Local<v8::FunctionTemplate> PerIsolateData::GetFunctionTemplate( |
+ WrapperInfo* info) { |
+ FunctionTemplateMap::iterator it = function_templates_.find(info); |
+ if (it == function_templates_.end()) |
+ return v8::Local<v8::FunctionTemplate>(); |
+ return it->second.Get(isolate_); |
+} |
+ |
} // namespace gin |