# HG changeset patch # User Thinker K.F. Li # Date 1275883923 -28800 # Node ID a3c13c2a4792344415e6c6e9e8539b58cb55c130 # Parent ce7a35abcb0dd0e4657d0ff30a7dca05fe01ebe3 Function template on runtime object for xnjsmb_coord_new() diff -r ce7a35abcb0d -r a3c13c2a4792 nodejs/mbfly_njs.cc --- 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 target) { HandleScope scope; Handle func; + Handle 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); } diff -r ce7a35abcb0d -r a3c13c2a4792 nodejs/mbfly_njs.h --- a/nodejs/mbfly_njs.h Mon Jun 07 11:47:34 2010 +0800 +++ b/nodejs/mbfly_njs.h Mon Jun 07 12:12:03 2010 +0800 @@ -18,5 +18,6 @@ #define GET(o, n) (o)->Get(v8::String::New(n)) redraw_man_t *xnjsmb_rt_rdman(v8::Handle mbrt); +v8::Handle xnjsmb_coord_new(const v8::Arguments &args); #endif /* __MBFLY_NJS_H_ */