# HG changeset patch # User Thinker K.F. Li # Date 1281094252 -28800 # Node ID 40ba8915edc7a3001024b3f4df147fc05832e5f8 # Parent efa666d118e57b95e93f2c72f50cfb1858139fe0 Support modifier function after creating a new object diff -r efa666d118e5 -r 40ba8915edc7 tools/gen_v8_binding.m4 --- 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 ]PROJ_PREFIX[]STRUCT_NAME[_get_$][1(Local 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