@@ -33,18 +33,12 @@ extern "C" {
3333/*  {{{ Class Entries */ 
3434zend_class_entry *php_ce_v8object;
3535zend_class_entry *php_ce_v8function;
36- 
37- #ifdef  V8JS_V8GENERATOR_SUPPORT
3836zend_class_entry *php_ce_v8generator;
39- #endif 
4037/*  }}} */ 
4138
4239/*  {{{ Object Handlers */ 
4340static  zend_object_handlers v8js_v8object_handlers;
44- 
45- #ifdef  V8JS_V8GENERATOR_SUPPORT
4641static  zend_object_handlers v8js_v8generator_handlers;
47- #endif 
4842/*  }}} */ 
4943
5044#define  V8JS_V8_INVOKE_FUNC_NAME  " V8Js::V8::Invoke" 
@@ -483,7 +477,6 @@ PHP_METHOD(V8Function, __wakeup)
483477/*  }}} */ 
484478
485479
486- #ifdef  V8JS_V8GENERATOR_SUPPORT
487480static  void  v8js_v8generator_free_storage (zend_object *object) /*  {{{ */ 
488481{
489482	v8js_v8generator *c = v8js_v8generator_fetch_object (object);
@@ -662,20 +655,16 @@ PHP_METHOD(V8Generator, valid)
662655	RETVAL_BOOL (!g->done );
663656}
664657/*  }}} */ 
665- #endif   /*  /V8JS_V8GENERATOR_SUPPORT */ 
666658
667659
668660void  v8js_v8object_create (zval *res, v8::Handle<v8::Value> value, int  flags, v8::Isolate *isolate TSRMLS_DC) /*  {{{ */ 
669661{
670662	v8js_ctx *ctx = (v8js_ctx *) isolate->GetData (0 );
671663
672- #ifdef  V8JS_V8GENERATOR_SUPPORT
673664	if (value->IsGeneratorObject ()) {
674665		object_init_ex (res, php_ce_v8generator);
675666	}
676- 	else 
677- #endif   /*  /V8JS_V8GENERATOR_SUPPORT */ 
678- 	if (value->IsFunction ()) {
667+ 	else  if (value->IsFunction ()) {
679668		object_init_ex (res, php_ce_v8function);
680669	}
681670	else  {
@@ -709,7 +698,6 @@ static const zend_function_entry v8js_v8function_methods[] = { /* {{{ */
709698};
710699/*  }}} */ 
711700
712- #ifdef  V8JS_V8GENERATOR_SUPPORT
713701ZEND_BEGIN_ARG_INFO (arginfo_v8generator_current, 0 )
714702ZEND_END_ARG_INFO()
715703
@@ -739,7 +727,6 @@ static const zend_function_entry v8js_v8generator_methods[] = { /* {{{ */
739727	{NULL , NULL , NULL }
740728};
741729/*  }}} */ 
742- #endif   /*  /V8JS_V8GENERATOR_SUPPORT */ 
743730
744731
745732PHP_MINIT_FUNCTION (v8js_v8object_class) /*  {{{ */ 
@@ -758,15 +745,13 @@ PHP_MINIT_FUNCTION(v8js_v8object_class) /* {{{ */
758745	php_ce_v8function->ce_flags  |= ZEND_ACC_FINAL;
759746	php_ce_v8function->create_object  = v8js_v8object_new;
760747
761- #ifdef  V8JS_V8GENERATOR_SUPPORT
762748	/*  V8Generator Class */ 
763749	INIT_CLASS_ENTRY (ce, " V8Generator"  , v8js_v8generator_methods);
764750	php_ce_v8generator = zend_register_internal_class (&ce TSRMLS_CC);
765751	php_ce_v8generator->ce_flags  |= ZEND_ACC_FINAL;
766752	php_ce_v8generator->create_object  = v8js_v8generator_new;
767753
768754	zend_class_implements (php_ce_v8generator, 1 , zend_ce_iterator);
769- #endif   /*  /V8JS_V8GENERATOR_SUPPORT */ 
770755
771756
772757	/*  V8<Object|Function> handlers */ 
@@ -786,13 +771,11 @@ PHP_MINIT_FUNCTION(v8js_v8object_class) /* {{{ */
786771	v8js_v8object_handlers.offset  = XtOffsetOf (struct  v8js_v8object , std);
787772	v8js_v8object_handlers.free_obj  = v8js_v8object_free_storage;
788773
789- #ifdef  V8JS_V8GENERATOR_SUPPORT
790774	/*  V8Generator handlers */ 
791775	memcpy (&v8js_v8generator_handlers, &v8js_v8object_handlers, sizeof (zend_object_handlers));
792776	v8js_v8generator_handlers.get_method  = v8js_v8generator_get_method;
793777	v8js_v8generator_handlers.offset  = XtOffsetOf (struct  v8js_v8generator , v8obj.std);
794778	v8js_v8generator_handlers.free_obj  = v8js_v8generator_free_storage;
795- #endif   /*  /V8JS_V8GENERATOR_SUPPORT */ 
796779
797780	return  SUCCESS;
798781} /*  }}} */ 
0 commit comments