changeset 678:40ba8915edc7

Support modifier function after creating a new object
author Thinker K.F. Li <thinker@branda.to>
date Fri, 06 Aug 2010 19:30:52 +0800
parents efa666d118e5
children 799c852b9065
files tools/gen_v8_binding.m4
diffstat 1 files changed, 13 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/tools/gen_v8_binding.m4	Fri Aug 06 18:39:37 2010 +0800
+++ b/tools/gen_v8_binding.m4	Fri Aug 06 19:30:52 2010 +0800
@@ -20,7 +20,7 @@
 
 define([fdefine], [dnl
 pushdef([$1], [$2])dnl
-define([_FRAME_VARS], QUOTE(_FRAME_VARS[popdef([$1])]))
+define([_FRAME_VARS], QUOTE(_FRAME_VARS[popdef([$1])]))dnl
 ])
 
 define([COUNT],[ifelse([$*],[],0,[$#])])
@@ -33,7 +33,7 @@
 
 define([START_ACCESSOR], [dnl
 divert([-1])dnl
-VARFRAME
+VARFRAME[]dnl
   fdefine([INT], [
 static Handle<Value>
 ]PROJ_PREFIX[]STRUCT_NAME[_get_$][1(Local<String> property, const AccessorInfo &info) {
@@ -161,7 +161,7 @@
 
 define([STOP_ACCESSOR], [dnl
 divert([-1])dnl
-UNVARFRAME[]
+UNVARFRAME[]dnl
 divert([])dnl
 ])
 
@@ -489,8 +489,11 @@
 define([SEP], [])dnl
     obj = ($4 *)$1(foreach([ITER], $2, [START_METHOD_ARG_PASS[]SEP[]ITER[]STOP_METHOD_ARG[]define([SEP], [, ])]));[]undefine([SEP])
 
-    WRAP(self, obj);
-])
+    WRAP(self, obj);]
+ifdef([STMOD], [
+    STMOD(self, obj);
+])dnl
+)
 
 dnl
 dnl STRUCT(struct_name, struct_type, member_vars, methods, options)
@@ -526,9 +529,11 @@
 
     func = ]PROJ_PREFIX[$1][_temp->GetFunction();
     obj = func->NewInstance();
-    WRAP(obj, data);
-
-    return obj;
+    WRAP(obj, data);]
+ifdef([STMOD], [
+    STMOD[(obj, data)];
+])dnl
+[   return obj;
 }
 ]dnl
 foreach([ITER], ($3), [START_ACCESSOR ITER STOP_ACCESSOR])dnl