@@ -89,7 +89,7 @@ namespace phpv8 {
8989 }
9090 }
9191
92- phpv8::Callback *CallbacksBucket::get (size_t index) {
92+ phpv8::Callback *CallbacksBucket::get (Index index) {
9393 auto it = callbacks.find (index);
9494
9595 if (it != callbacks.end ()) {
@@ -99,7 +99,7 @@ namespace phpv8 {
9999 return NULL ;
100100 }
101101
102- void CallbacksBucket::add (size_t index, zend_fcall_info fci, zend_fcall_info_cache fci_cache) {
102+ void CallbacksBucket::add (Index index, zend_fcall_info fci, zend_fcall_info_cache fci_cache) {
103103 callbacks[index] = std::make_shared<Callback>(fci, fci_cache);
104104 }
105105
@@ -235,7 +235,7 @@ static inline void php_v8_callback_set_retval_from_callback_info(v8::ReturnValue
235235}
236236
237237
238- void php_v8_callback_call_from_bucket_with_zargs (size_t index, v8::Local<v8::Value> data, zval *args, zval *retval) {
238+ void php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index index, v8::Local<v8::Value> data, zval *args, zval *retval) {
239239 phpv8::CallbacksBucket *bucket;
240240
241241 if (data.IsEmpty () || !data->IsExternal ()) {
@@ -275,7 +275,7 @@ void php_v8_callback_call_from_bucket_with_zargs(size_t index, v8::Local<v8::Val
275275}
276276
277277template <class T , class M >
278- void php_v8_callback_call_from_bucket_with_zargs (size_t index, const T &info, M rv, zval *args) {
278+ void php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index index, const T &info, M rv, zval *args) {
279279 zval callback_info;
280280 php_v8_return_value_t *php_v8_return_value;
281281 // Wrap callback info
@@ -304,7 +304,7 @@ void php_v8_callback_function(const v8::FunctionCallbackInfo<v8::Value> &info) {
304304 /* Build the parameter array */
305305 array_init_size (&args, 1 );
306306
307- php_v8_callback_call_from_bucket_with_zargs (0 , info, info.GetReturnValue (), &args);
307+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Callback , info, info.GetReturnValue (), &args);
308308
309309 zval_ptr_dtor (&args);
310310}
@@ -322,7 +322,7 @@ void php_v8_callback_accessor_name_getter(v8::Local<v8::Name> property, const v8
322322 php_v8_get_or_create_value (&property_name, property, php_v8_isolate);
323323 add_index_zval (&args, 0 , &property_name);
324324
325- php_v8_callback_call_from_bucket_with_zargs (0 , info, info.GetReturnValue (), &args);
325+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Getter , info, info.GetReturnValue (), &args);
326326
327327 zval_ptr_dtor (&args);
328328}
@@ -344,7 +344,7 @@ void php_v8_callback_accessor_name_setter(v8::Local<v8::Name> property, v8::Loca
344344 add_index_zval (&args, 0 , &property_name);
345345 add_index_zval (&args, 1 , &property_value);
346346
347- php_v8_callback_call_from_bucket_with_zargs (1 , info, info.GetReturnValue (), &args);
347+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Setter , info, info.GetReturnValue (), &args);
348348
349349 zval_ptr_dtor (&args);
350350}
@@ -363,7 +363,7 @@ void php_v8_callback_generic_named_property_getter(v8::Local<v8::Name> property,
363363 php_v8_get_or_create_value (&property_name, property, php_v8_isolate);
364364 add_index_zval (&args, 0 , &property_name);
365365
366- php_v8_callback_call_from_bucket_with_zargs (0 , info, info.GetReturnValue (), &args);
366+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Getter , info, info.GetReturnValue (), &args);
367367
368368 zval_ptr_dtor (&args);
369369}
@@ -385,7 +385,7 @@ void php_v8_callback_generic_named_property_setter(v8::Local<v8::Name> property,
385385 add_index_zval (&args, 0 , &property_name);
386386 add_index_zval (&args, 1 , &property_value);
387387
388- php_v8_callback_call_from_bucket_with_zargs (1 , info, info.GetReturnValue (), &args);
388+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Setter , info, info.GetReturnValue (), &args);
389389
390390 zval_ptr_dtor (&args);
391391}
@@ -403,7 +403,7 @@ void php_v8_callback_generic_named_property_query(v8::Local<v8::Name> property,
403403 php_v8_get_or_create_value (&property_name, property, php_v8_isolate);
404404 add_index_zval (&args, 0 , &property_name);
405405
406- php_v8_callback_call_from_bucket_with_zargs (2 , info, info.GetReturnValue (), &args);
406+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Query , info, info.GetReturnValue (), &args);
407407
408408 zval_ptr_dtor (&args);
409409}
@@ -421,7 +421,7 @@ void php_v8_callback_generic_named_property_deleter(v8::Local<v8::Name> property
421421 php_v8_get_or_create_value (&property_name, property, php_v8_isolate);
422422 add_index_zval (&args, 0 , &property_name);
423423
424- php_v8_callback_call_from_bucket_with_zargs (3 , info, info.GetReturnValue (), &args);
424+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Deleter , info, info.GetReturnValue (), &args);
425425
426426 zval_ptr_dtor (&args);
427427}
@@ -434,7 +434,7 @@ void php_v8_callback_generic_named_property_enumerator(const v8::PropertyCallbac
434434 /* Build the parameter array */
435435 array_init_size (&args, 1 );
436436
437- php_v8_callback_call_from_bucket_with_zargs (4 , info, info.GetReturnValue (), &args);
437+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Enumerator , info, info.GetReturnValue (), &args);
438438
439439 zval_ptr_dtor (&args);
440440}
@@ -453,7 +453,7 @@ void php_v8_callback_indexed_property_getter(uint32_t index, const v8::PropertyC
453453 ZVAL_LONG (&property_name, index);
454454 add_index_zval (&args, 0 , &property_name);
455455
456- php_v8_callback_call_from_bucket_with_zargs (0 , info, info.GetReturnValue (), &args);
456+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Getter , info, info.GetReturnValue (), &args);
457457
458458 zval_ptr_dtor (&args);
459459}
@@ -475,7 +475,7 @@ void php_v8_callback_indexed_property_setter(uint32_t index, v8::Local<v8::Value
475475 add_index_zval (&args, 0 , &property_name);
476476 add_index_zval (&args, 1 , &property_value);
477477
478- php_v8_callback_call_from_bucket_with_zargs (1 , info, info.GetReturnValue (), &args);
478+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Setter , info, info.GetReturnValue (), &args);
479479
480480 zval_ptr_dtor (&args);
481481}
@@ -492,7 +492,7 @@ void php_v8_callback_indexed_property_query(uint32_t index, const v8::PropertyCa
492492 ZVAL_LONG (&property_name, index);
493493 add_index_zval (&args, 0 , &property_name);
494494
495- php_v8_callback_call_from_bucket_with_zargs (2 , info, info.GetReturnValue (), &args);
495+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Query , info, info.GetReturnValue (), &args);
496496
497497 zval_ptr_dtor (&args);
498498}
@@ -509,7 +509,7 @@ void php_v8_callback_indexed_property_deleter(uint32_t index, const v8::Property
509509 ZVAL_LONG (&property_name, index);
510510 add_index_zval (&args, 0 , &property_name);
511511
512- php_v8_callback_call_from_bucket_with_zargs (3 , info, info.GetReturnValue (), &args);
512+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Deleter , info, info.GetReturnValue (), &args);
513513
514514 zval_ptr_dtor (&args);
515515}
@@ -522,7 +522,7 @@ void php_v8_callback_indexed_property_enumerator(const v8::PropertyCallbackInfo<
522522 /* Build the parameter array */
523523 array_init_size (&args, 1 );
524524
525- php_v8_callback_call_from_bucket_with_zargs (4 , info, info.GetReturnValue (), &args);
525+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Enumerator , info, info.GetReturnValue (), &args);
526526
527527 zval_ptr_dtor (&args);
528528}
@@ -556,7 +556,7 @@ bool php_v8_callback_access_check(v8::Local<v8::Context> accessing_context, v8::
556556 add_index_zval (&args, 0 , &context_zv);
557557 add_index_zval (&args, 1 , &accessed_object_zv);
558558
559- php_v8_callback_call_from_bucket_with_zargs (0 , data, &args, &retval);
559+ php_v8_callback_call_from_bucket_with_zargs (phpv8::CallbacksBucket::Index::Callback , data, &args, &retval);
560560
561561 if (Z_TYPE (retval) == IS_TRUE) {
562562 security_retval = true ;
0 commit comments