diff nodejs/mbfly_njs.cc @ 561:a3c13c2a4792 Android_Skia

Function template on runtime object for xnjsmb_coord_new()
author Thinker K.F. Li <thinker@branda.to>
date Mon, 07 Jun 2010 12:12:03 +0800
parents ef078d7c57b4
children 1b6402f07cd4
line wrap: on
line diff
--- a/nodejs/mbfly_njs.cc	Mon Jun 07 11:47:34 2010 +0800
+++ b/nodejs/mbfly_njs.cc	Mon Jun 07 12:12:03 2010 +0800
@@ -85,11 +85,16 @@
 init(Handle<Object> target) {
     HandleScope scope;
     Handle<FunctionTemplate> func;
+    Handle<ObjectTemplate> rt_obj_temp;
 
     func = FunctionTemplate::New(hello_func);
     target->Set(String::New("Hello"), func->GetFunction());
 
     func = FunctionTemplate::New(xnjsmb_new);
     target->Set(String::New("mb_rt"), func->GetFunction());
-    func->PrototypeTemplate()->SetInternalFieldCount(1);
+    rt_obj_temp = func->PrototypeTemplate();
+    rt_obj_temp->SetInternalFieldCount(1);
+    
+    func = FunctionTemplate::New(xnjsmb_coord_new);
+    SET(rt_obj_temp, "coord_new", func);
 }