@@ -75,9 +75,9 @@ bool php_v8_function_unpack_args(zval *arguments_zv, int arg_position, v8::Isola
7575
7676 php_v8_tmp_data = PHP_V8_VALUE_FETCH (pzval);
7777
78- // NOTE: check for emptiness may be considered redundant while we may catch the fact that value was not properly
79- // constructed by checking isolates mismatch, but this check serves for user-friendly purposes to throw
80- // less confusing exception message
78+ // Check for emptiness may be considered redundant while we may catch the fact that value was not properly
79+ // constructed by checking isolates mismatch, but this check serves for user-friendly purposes to throw
80+ // less confusing exception message
8181 if (NULL == php_v8_tmp_data->persistent || php_v8_tmp_data->persistent ->IsEmpty ()) {
8282 spprintf (&exception_message, 0 , PHP_V8_EMPTY_VALUE_MSG " : argument %d passed to %s::%s() at %d offset" ,
8383 arg_position, ZSTR_VAL (ce_name), get_active_function_name (), i);
@@ -164,9 +164,9 @@ bool php_v8_function_unpack_string_args(zval* arguments_zv, int arg_position, v8
164164
165165 php_v8_tmp_data = PHP_V8_VALUE_FETCH (pzval);
166166
167- // NOTE: check for emptiness may be considered redundant while we may catch the fact that value was not properly
168- // constructed by checking isolates mismatch, but this check serves for user-friendly purposes to throw
169- // less confusing exception message
167+ // Check for emptiness may be considered redundant while we may catch the fact that value was not properly
168+ // constructed by checking isolates mismatch, but this check serves for user-friendly purposes to throw
169+ // less confusing exception message
170170 if (NULL == php_v8_tmp_data->persistent || php_v8_tmp_data->persistent ->IsEmpty ()) {
171171 spprintf (&exception_message, 0 , PHP_V8_EMPTY_VALUE_MSG " : argument %d passed to %s::%s() at %d offset" ,
172172 arg_position, ZSTR_VAL (ce_name), get_active_function_name (), i);
@@ -253,9 +253,9 @@ bool php_v8_function_unpack_object_args(zval* arguments_zv, int arg_position, v8
253253
254254 php_v8_tmp_data = PHP_V8_VALUE_FETCH (pzval);
255255
256- // NOTE: check for emptiness may be considered redundant while we may catch the fact that value was not properly
257- // constructed by checking isolates mismatch, but this check serves for user-friendly purposes to throw
258- // less confusing exception message
256+ // Check for emptiness may be considered redundant while we may catch the fact that value was not properly
257+ // constructed by checking isolates mismatch, but this check serves for user-friendly purposes to throw
258+ // less confusing exception message
259259 if (NULL == php_v8_tmp_data->persistent || php_v8_tmp_data->persistent ->IsEmpty ()) {
260260 spprintf (&exception_message, 0 , PHP_V8_EMPTY_VALUE_MSG " : argument %d passed to %s::%s() at %d offset" ,
261261 arg_position, ZSTR_VAL (ce_name), get_active_function_name (), i);
@@ -333,14 +333,7 @@ static PHP_METHOD(V8Function, __construct) {
333333 callback = php_v8_callback_function;
334334 }
335335
336- // TODO: check length range (PHP uses long, while V8 uses int
337-
338- v8::MaybeLocal<v8::Function> maybe_local_function = v8::Function::New (
339- context,
340- callback,
341- data,
342- (int ) length
343- );
336+ v8::MaybeLocal<v8::Function> maybe_local_function = v8::Function::New (context, callback, data, static_cast <int >(length));
344337
345338 if (maybe_local_function.IsEmpty ()) {
346339 PHP_V8_THROW_EXCEPTION (" Failed to create Function value" );
0 commit comments