comparison tools/gen_v8_binding.m4 @ 669:eeea1b593a2f

Add handle scope for function and method generated
author Thinker K.F. Li <thinker@branda.to>
date Thu, 05 Aug 2010 09:38:07 +0800
parents 916dc9723086
children f0b4fbcd1c51
comparison
equal deleted inserted replaced
668:916dc9723086 669:eeea1b593a2f
308 foreach([ITER], ]$][6[, [EXPAND([define]ITER)])dnl 308 foreach([ITER], ]$][6[, [EXPAND([define]ITER)])dnl
309 ])dnl 309 ])dnl
310 dnl 310 dnl
311 static Handle<Value> 311 static Handle<Value>
312 PROJ_PREFIX[]STRUCT_NAME[]_$][1(const Arguments &args) { 312 PROJ_PREFIX[]STRUCT_NAME[]_$][1(const Arguments &args) {
313 HandleScope scope;
313 int i; 314 int i;
314 int argc = args.Length(); 315 int argc = args.Length();
315 Handle<Object> self = args.This(); 316 Handle<Object> self = args.This();
316 STRUCT_TYPE *_self = (STRUCT_TYPE *)UNWRAP(self); 317 STRUCT_TYPE *_self = (STRUCT_TYPE *)UNWRAP(self);
317 const char *_err = NULL; 318 const char *_err = NULL;
340 dnl Modify returned object 341 dnl Modify returned object
341 dnl 342 dnl
342 ifdef([MOD], [ 343 ifdef([MOD], [
343 MOD[](self, _ret_val); 344 MOD[](self, _ret_val);
344 ])dnl 345 ])dnl
346 scope.Close(_ret_val);
345 return _ret_val; 347 return _ret_val;
346 ])dnl 348 ])dnl
347 } 349 }
348 ifelse($][6, [], [], [dnl 350 ifelse($][6, [], [], [dnl
349 foreach([ITER], ]$][6[, [EXPAND([undefine]ITER)])dnl 351 foreach([ITER], ]$][6[, [EXPAND([undefine]ITER)])dnl
520 * [FUNCTION]: $1 522 * [FUNCTION]: $1
521 * Generated by gen_v8_binding.m4 523 * Generated by gen_v8_binding.m4
522 */ 524 */
523 static Handle<Value> 525 static Handle<Value>
524 PROJ_PREFIX[]$1(const Arguments &args) { 526 PROJ_PREFIX[]$1(const Arguments &args) {
527 HandleScope scope;
525 int argc = args.Length(); 528 int argc = args.Length();
526 int i; 529 int i;
527 const char *_err = NULL; 530 const char *_err = NULL;
528 foreach([ITER], ($3), [START_METHOD_ARG_VAR[]ITER[]STOP_METHOD_ARG])dnl 531 foreach([ITER], ($3), [START_METHOD_ARG_VAR[]ITER[]STOP_METHOD_ARG])dnl
529 START_METHOD_RET_VAL[]$5[]STOP_METHOD_ARG[]dnl 532 START_METHOD_RET_VAL[]$5[]STOP_METHOD_ARG[]dnl
551 dnl Modify returned object 554 dnl Modify returned object
552 dnl 555 dnl
553 ifdef([MOD], [ 556 ifdef([MOD], [
554 MOD[](self, _ret_val); 557 MOD[](self, _ret_val);
555 ])dnl 558 ])dnl
559 scope.Close(_ret_val);
556 return _ret_val; 560 return _ret_val;
557 ])dnl 561 ])dnl
558 } 562 }
559 static Persistent<FunctionTemplate> PROJ_PREFIX[]$1[]_temp; 563 static Persistent<FunctionTemplate> PROJ_PREFIX[]$1[]_temp;
560 564