@@ -26,37 +26,38 @@ zend_class_entry *php_v8_property_callback_info_class_entry;
2626
2727
2828template <class T >
29- void php_v8_callback_info_create_from_info_meta (zval *this_ptr, const v8::PropertyCallbackInfo<T> &info, int accepts);
29+ php_v8_callback_info_t * php_v8_callback_info_create_from_info_meta (zval *this_ptr, const v8::PropertyCallbackInfo<T> &info, int accepts);
3030
3131
32- void php_v8_callback_info_create_from_info (zval *this_ptr, const v8::PropertyCallbackInfo<v8::Value> &info) {
33- php_v8_callback_info_create_from_info_meta (this_ptr, info, PHP_V8_RETVAL_ACCEPTS_ANY);
32+ php_v8_callback_info_t * php_v8_callback_info_create_from_info (zval *this_ptr, const v8::PropertyCallbackInfo<v8::Value> &info) {
33+ return php_v8_callback_info_create_from_info_meta (this_ptr, info, PHP_V8_RETVAL_ACCEPTS_ANY);
3434}
3535
36- void php_v8_callback_info_create_from_info (zval *this_ptr, const v8::PropertyCallbackInfo<v8::Array> &info) {
37- php_v8_callback_info_create_from_info_meta (this_ptr, info, PHP_V8_RETVAL_ACCEPTS_ARRAY);
36+ php_v8_callback_info_t * php_v8_callback_info_create_from_info (zval *this_ptr, const v8::PropertyCallbackInfo<v8::Array> &info) {
37+ return php_v8_callback_info_create_from_info_meta (this_ptr, info, PHP_V8_RETVAL_ACCEPTS_ARRAY);
3838}
3939
40- void php_v8_callback_info_create_from_info (zval *this_ptr, const v8::PropertyCallbackInfo<v8::Integer> &info) {
41- php_v8_callback_info_create_from_info_meta (this_ptr, info, PHP_V8_RETVAL_ACCEPTS_INTEGER);
40+ php_v8_callback_info_t * php_v8_callback_info_create_from_info (zval *this_ptr, const v8::PropertyCallbackInfo<v8::Integer> &info) {
41+ return php_v8_callback_info_create_from_info_meta (this_ptr, info, PHP_V8_RETVAL_ACCEPTS_INTEGER);
4242}
4343
44- void php_v8_callback_info_create_from_info (zval *this_ptr, const v8::PropertyCallbackInfo<v8::Boolean> &info) {
45- php_v8_callback_info_create_from_info_meta (this_ptr, info, PHP_V8_RETVAL_ACCEPTS_BOOLEAN);
44+ php_v8_callback_info_t * php_v8_callback_info_create_from_info (zval *this_ptr, const v8::PropertyCallbackInfo<v8::Boolean> &info) {
45+ return php_v8_callback_info_create_from_info_meta (this_ptr, info, PHP_V8_RETVAL_ACCEPTS_BOOLEAN);
4646}
4747
48- void php_v8_callback_info_create_from_info (zval *this_ptr, const v8::PropertyCallbackInfo<void > &info) {
49- php_v8_callback_info_create_from_info_meta (this_ptr, info, PHP_V8_RETVAL_ACCEPTS_VOID);
48+ php_v8_callback_info_t * php_v8_callback_info_create_from_info (zval *this_ptr, const v8::PropertyCallbackInfo<void > &info) {
49+ return php_v8_callback_info_create_from_info_meta (this_ptr, info, PHP_V8_RETVAL_ACCEPTS_VOID);
5050}
5151
5252template <class T >
53- void php_v8_callback_info_create_from_info_meta (zval *this_ptr, const v8::PropertyCallbackInfo<T> &info, int accepts) {
53+ php_v8_callback_info_t *php_v8_callback_info_create_from_info_meta (zval *this_ptr, const v8::PropertyCallbackInfo<T> &info, int accepts) {
54+ zval retval;
5455 v8::Isolate *isolate = info.GetIsolate ();
5556 v8::Local<v8::Context> context = isolate->GetCurrentContext ();
5657
5758 if (context.IsEmpty ()) {
5859 PHP_V8_THROW_EXCEPTION (" Internal exception: no calling context found" );
59- return ;
60+ return NULL ;
6061 }
6162
6263 object_init_ex (this_ptr, this_ce);
@@ -65,15 +66,17 @@ void php_v8_callback_info_create_from_info_meta(zval *this_ptr, const v8::Proper
6566 php_v8_callback_info->php_v8_isolate = PHP_V8_ISOLATE_FETCH_REFERENCE (isolate);
6667 php_v8_callback_info->php_v8_context = php_v8_context_get_reference (context);
6768
68- PHP_V8_COPY_ISOLATE_OBJECT_HANDLE (php_v8_callback_info->php_v8_isolate , php_v8_callback_info);
69-
7069 php_v8_callback_info->this_obj ->Reset (isolate, info.This ());
7170 php_v8_callback_info->holder_obj ->Reset (isolate, info.Holder ());
7271
73- php_v8_return_value_create_from_return_value (&php_v8_callback_info->retval ,
74- php_v8_callback_info->php_v8_isolate ,
75- php_v8_callback_info->php_v8_context ,
76- accepts);
72+ php_v8_callback_info->php_v8_return_value = php_v8_return_value_create_from_return_value (
73+ &retval,
74+ php_v8_callback_info->php_v8_isolate ,
75+ php_v8_callback_info->php_v8_context ,
76+ accepts
77+ );
78+
79+ return php_v8_callback_info;
7780}
7881
7982static const zend_function_entry php_v8_property_callback_info_methods[] = {
0 commit comments