From a3e74c23a0d6accf62743aeb075c333da63f834d Mon Sep 17 00:00:00 2001 From: Bogdan Padalko Date: Tue, 29 Aug 2017 23:51:20 +0300 Subject: [PATCH 1/2] Refactor methods name to follow PSR-2 camelCase convention --- README.md | 8 +- src/php_v8_array.cc | 12 +- src/php_v8_boolean.cc | 12 +- src/php_v8_boolean_object.cc | 12 +- src/php_v8_cached_data.cc | 18 +- src/php_v8_callback_info.cc | 30 +- src/php_v8_context.cc | 60 +- src/php_v8_date.cc | 18 +- src/php_v8_exception.cc | 44 +- src/php_v8_exceptions.cc | 24 +- src/php_v8_ext_mem_interface.cc | 8 +- src/php_v8_function.cc | 70 +- src/php_v8_function_callback_info.cc | 24 +- src/php_v8_function_template.cc | 120 ++-- src/php_v8_heap_statistics.cc | 62 +- ..._indexed_property_handler_configuration.cc | 4 +- src/php_v8_int32.cc | 12 +- src/php_v8_integer.cc | 12 +- src/php_v8_isolate.cc | 114 +-- src/php_v8_map.cc | 48 +- src/php_v8_message.cc | 78 +- src/php_v8_name.cc | 6 +- ...v8_named_property_handler_configuration.cc | 4 +- src/php_v8_null.cc | 12 +- src/php_v8_number.cc | 12 +- src/php_v8_number_object.cc | 12 +- src/php_v8_object.cc | 244 +++---- src/php_v8_object_template.cc | 72 +- src/php_v8_property_callback_info.cc | 6 +- src/php_v8_regexp.cc | 18 +- src/php_v8_return_value.cc | 66 +- src/php_v8_script.cc | 30 +- src/php_v8_script_compiler.cc | 24 +- src/php_v8_script_origin.cc | 44 +- src/php_v8_script_origin_options.cc | 30 +- src/php_v8_set.cc | 42 +- src/php_v8_source.cc | 24 +- src/php_v8_stack_frame.cc | 54 +- src/php_v8_stack_trace.cc | 30 +- src/php_v8_startup_data.cc | 24 +- src/php_v8_string.cc | 36 +- src/php_v8_string_object.cc | 12 +- src/php_v8_symbol.cc | 94 +-- src/php_v8_symbol_object.cc | 12 +- src/php_v8_template.cc | 16 +- src/php_v8_try_catch.cc | 54 +- src/php_v8_uint32.cc | 12 +- src/php_v8_unbound_script.cc | 48 +- src/php_v8_undefined.cc | 12 +- src/php_v8_value.cc | 442 ++++++------ .../src/AdjustableExternalMemoryInterface.php | 5 +- stubs/src/ArrayObject.php | 2 +- stubs/src/BooleanObject.php | 2 +- stubs/src/BooleanValue.php | 2 +- stubs/src/CallbackInfo.php | 10 +- stubs/src/Context.php | 22 +- stubs/src/DateObject.php | 4 +- stubs/src/Exception.php | 14 +- stubs/src/Exceptions/TryCatchException.php | 6 +- stubs/src/FunctionCallbackInfo.php | 8 +- stubs/src/FunctionObject.php | 20 +- stubs/src/FunctionTemplate.php | 26 +- stubs/src/Int32Value.php | 2 +- stubs/src/IntegerValue.php | 2 +- stubs/src/Isolate.php | 36 +- stubs/src/MapObject.php | 14 +- stubs/src/Message.php | 24 +- stubs/src/NameValue.php | 2 +- stubs/src/NullValue.php | 2 +- stubs/src/NumberObject.php | 2 +- stubs/src/NumberValue.php | 2 +- stubs/src/ObjectTemplate.php | 14 +- stubs/src/ObjectValue.php | 78 +- stubs/src/PrimitiveValue.php | 2 +- stubs/src/PropertyCallbackInfo.php | 2 +- stubs/src/RegExpObject.php | 4 +- stubs/src/ReturnValue.php | 64 +- stubs/src/Script.php | 8 +- stubs/src/ScriptCompiler.php | 8 +- stubs/src/ScriptCompiler/Source.php | 6 +- stubs/src/ScriptOrigin.php | 12 +- stubs/src/ScriptOriginOptions.php | 8 +- stubs/src/SetObject.php | 14 +- stubs/src/StackFrame.php | 16 +- stubs/src/StackTrace.php | 8 +- stubs/src/StartupData.php | 6 +- stubs/src/StringObject.php | 2 +- stubs/src/StringValue.php | 10 +- stubs/src/SymbolObject.php | 2 +- stubs/src/SymbolValue.php | 30 +- stubs/src/Template.php | 8 +- stubs/src/TryCatch.php | 26 +- stubs/src/Uint32Value.php | 2 +- stubs/src/UnboundScript.php | 12 +- stubs/src/UndefinedValue.php | 2 +- stubs/src/Value.php | 84 +-- tests/.v8-helpers.php | 83 +-- tests/001-verify-method-case.phpt | 59 ++ .../003-V8ObjectTemplate_recursive_chain.phpt | 8 +- ...003-V8ObjectTemplate_recursive_global.phpt | 2 +- .../003-V8ObjectTemplate_recursive_self.phpt | 6 +- .../003-V8ObjectTemplate_recursive_tree.phpt | 28 +- ....phpt => 004-ICU-Intl_dateTimeFormat.phpt} | 6 +- ...at.phpt => 004-ICU-Intl_numberFormat.phpt} | 0 ...05-V8FunctionTemplate_external_memory.phpt | 10 +- .../005-V8ObjectTemplate_external_memory.phpt | 10 +- tests/005-V8ObjectValue_external_memory.phpt | 10 +- tests/V8ArrayObject.phpt | 144 ++-- ..._Length.phpt => V8ArrayObject_length.phpt} | 10 +- tests/V8Boolean.phpt | 124 ++-- tests/V8BooleanObject.phpt | 214 +++--- tests/V8CachedData.phpt | 20 +- tests/V8Context.phpt | 26 +- ...bject.phpt => V8Context_globalObject.phpt} | 16 +- tests/V8Context_reference_lifecycle.phpt | 6 +- ...n.phpt => V8Context_setSecurityToken.phpt} | 34 +- tests/V8Context_weakness.phpt | 2 +- tests/V8DateObject.phpt | 130 ++-- tests/V8Exception_CreateMessage.phpt | 219 ------ tests/V8Exception_Error.phpt | 155 ---- tests/V8Exception_RangeError.phpt | 155 ---- tests/V8Exception_ReferenceError.phpt | 155 ---- tests/V8Exception_SyntaxError.phpt | 155 ---- tests/V8Exception_TypeError.phpt | 155 ---- tests/V8Exception_createMessage.phpt | 219 ++++++ tests/V8Exception_error.phpt | 155 ++++ ...ce.phpt => V8Exception_getStackTrace.phpt} | 26 +- tests/V8Exception_rangeError.phpt | 155 ++++ tests/V8Exception_referenceError.phpt | 155 ++++ tests/V8Exception_syntaxError.phpt | 155 ++++ tests/V8Exception_typeError.phpt | 155 ++++ tests/V8ExceptionsTryCatchException.phpt | 12 +- tests/V8FunctionCallbackInfo.phpt | 22 +- tests/V8FunctionObject.phpt | 116 +-- tests/V8FunctionObject_Call.phpt | 234 ------ tests/V8FunctionObject_call.phpt | 234 ++++++ ...pt => V8FunctionObject_call_bad_args.phpt} | 18 +- ...V8FunctionObject_constructor_behavior.phpt | 4 +- tests/V8FunctionObject_die.phpt | 4 +- ...FunctionObject_die_different_isolates.phpt | 12 +- tests/V8FunctionObject_die_nested.phpt | 10 +- ...phpt => V8FunctionObject_newInstance.phpt} | 14 +- tests/V8FunctionObject_weakness_multiple.phpt | 18 +- tests/V8FunctionTemplate.phpt | 50 +- .../V8FunctionTemplate_callback_weakness.phpt | 4 +- ...FunctionTemplate_constructor_behavior.phpt | 4 +- ...FunctionTemplate_constructor_receiver.phpt | 10 +- .../V8FunctionTemplate_exception_in_php.phpt | 4 +- ...pt => V8FunctionTemplate_getFunction.phpt} | 12 +- ...nctionTemplate_require_implementation.phpt | 26 +- ...e_Set.phpt => V8FunctionTemplate_set.phpt} | 16 +- ...=> V8FunctionTemplate_setCallHandler.phpt} | 16 +- tests/V8FunctionTemplate_weakness.phpt | 4 +- tests/V8Int32Value.phpt | 242 +++---- tests/V8IntegerValue.phpt | 242 +++---- tests/V8Isolate.phpt | 4 +- tests/V8Isolate_ThrowException.phpt | 278 -------- tests/V8Isolate_gc_cyclic_ref_memleak.phpt | 8 +- ....phpt => V8Isolate_getEnteredContext.phpt} | 8 +- ...late_IsDead.phpt => V8Isolate_isDead.phpt} | 6 +- ...te_IsInUse.phpt => V8Isolate_isInUse.phpt} | 10 +- tests/V8Isolate_limit_memory.phpt | 16 +- tests/V8Isolate_limit_memory_nested.phpt | 20 +- tests/V8Isolate_limit_memory_not_hit.phpt | 14 +- tests/V8Isolate_limit_time.phpt | 14 +- ...te_limit_time_affects_js_runtime_only.phpt | 14 +- ...Isolate_limit_time_changed_at_runtime.phpt | 20 +- tests/V8Isolate_limit_time_nested.phpt | 20 +- tests/V8Isolate_limit_time_not_hit.phpt | 14 +- ...olate_limit_time_set_during_execution.phpt | 8 +- ...Isolate_nested_termination_exceptions.phpt | 20 +- tests/V8Isolate_snapshot_support.phpt | 14 +- tests/V8Isolate_throwException.phpt | 278 ++++++++ ...Isolate_throwException_with_external.phpt} | 24 +- tests/V8MapObject.phpt | 216 +++--- tests/V8Message.phpt | 96 +-- tests/V8NullValue.phpt | 124 ++-- tests/V8NumberObject.phpt | 220 +++--- tests/V8NumberValue.phpt | 176 ++--- tests/V8ObjectTemplate.phpt | 10 +- ...ate_Set.phpt => V8ObjectTemplate_set.phpt} | 6 +- ...8ObjectTemplate_setAccessor_receiver.phpt} | 12 +- ...ectTemplate_setCallAsFunctionHandler.phpt} | 18 +- ...emplate_setHandlerForIndexedProperty.phpt} | 24 +- ...tTemplate_setHandlerForNamedProperty.phpt} | 32 +- ... => V8ObjectTemplate_setHandler_both.phpt} | 52 +- ...ObjectTemplate_setNativeDataProperty.phpt} | 14 +- tests/V8ObjectValue.phpt | 136 ++-- ...tValue_Get.phpt => V8ObjectValue_get.phpt} | 14 +- ...t => V8ObjectValue_isArgumentsObject.phpt} | 20 +- ....phpt => V8ObjectValue_isNativeError.phpt} | 20 +- ...or.phpt => V8ObjectValue_setAccessor.phpt} | 32 +- ...t => V8ObjectValue_setIntegrityLevel.phpt} | 20 +- ... V8ObjectValue_setNativeDataProperty.phpt} | 14 +- ..._setNativeDataProperty_from_template.phpt} | 34 +- tests/V8PropertyCallbackInfo.phpt | 12 +- tests/V8RegExpObject.phpt | 116 +-- tests/V8ReturnValue.phpt | 28 +- tests/V8ReturnValue_context.phpt | 22 +- tests/V8Script.phpt | 120 ++-- tests/V8ScriptCompiler.phpt | 4 +- ...ile.phpt => V8ScriptCompiler_compile.phpt} | 126 ++-- ...iptCompiler_compileFunctionInContext.phpt} | 54 +- ...t => V8ScriptCompiler_compileUnbound.phpt} | 112 +-- tests/V8ScriptOrigin.phpt | 76 +- tests/V8ScriptOriginOptions.phpt | 40 +- tests/V8Script_Run.phpt | 122 ---- ...V8Script_exit_during_script_execution.phpt | 6 +- tests/V8Script_run.phpt | 122 ++++ ...y.phpt => V8Script_run_out_of_memory.phpt} | 14 +- ...t => V8Script_run_uncaught_exception.phpt} | 4 +- .../V8Script_terminate_script_execution.phpt | 14 +- tests/V8SetObject.phpt | 226 +++--- tests/V8Source.phpt | 48 +- tests/V8StackFrame.phpt | 64 +- tests/V8StackTrace.phpt | 12 +- ...pt => V8StackTrace_currentStackTrace.phpt} | 22 +- ...pt => V8StartupData_createFromSource.phpt} | 14 +- tests/V8StringObject.phpt | 220 +++--- tests/V8StringValue.phpt | 206 +++--- tests/V8SymbolObject.phpt | 114 +-- tests/V8SymbolValue.phpt | 674 +++++++++--------- tests/V8TryCatch.phpt | 58 +- tests/V8TryCatch_from_script.phpt | 60 +- tests/V8Uint32Value.phpt | 130 ++-- tests/V8UnboundScript.phpt | 58 +- tests/V8Undefined.phpt | 240 +++---- tests/V8Value_empty.phpt | 4 +- 228 files changed, 6255 insertions(+), 6174 deletions(-) create mode 100644 tests/001-verify-method-case.phpt rename tests/{004-ICU-Intl_DateTimeFormat.phpt => 004-ICU-Intl_dateTimeFormat.phpt} (98%) rename tests/{004-ICU-Intl_NumberFormat.phpt => 004-ICU-Intl_numberFormat.phpt} (100%) rename tests/{V8ArrayObject_Length.phpt => V8ArrayObject_length.phpt} (73%) rename tests/{V8Context_GlobalObject.phpt => V8Context_globalObject.phpt} (72%) rename tests/{V8Context_SetSecurityToken.phpt => V8Context_setSecurityToken.phpt} (65%) delete mode 100644 tests/V8Exception_CreateMessage.phpt delete mode 100644 tests/V8Exception_Error.phpt delete mode 100644 tests/V8Exception_RangeError.phpt delete mode 100644 tests/V8Exception_ReferenceError.phpt delete mode 100644 tests/V8Exception_SyntaxError.phpt delete mode 100644 tests/V8Exception_TypeError.phpt create mode 100644 tests/V8Exception_createMessage.phpt create mode 100644 tests/V8Exception_error.phpt rename tests/{V8Exception_GetStackTrace.phpt => V8Exception_getStackTrace.phpt} (82%) create mode 100644 tests/V8Exception_rangeError.phpt create mode 100644 tests/V8Exception_referenceError.phpt create mode 100644 tests/V8Exception_syntaxError.phpt create mode 100644 tests/V8Exception_typeError.phpt delete mode 100644 tests/V8FunctionObject_Call.phpt create mode 100644 tests/V8FunctionObject_call.phpt rename tests/{V8FunctionObject_Call_bad_args.phpt => V8FunctionObject_call_bad_args.phpt} (72%) rename tests/{V8FunctionObject_NewInstance.phpt => V8FunctionObject_newInstance.phpt} (63%) rename tests/{V8FunctionTemplate_GetFunction.phpt => V8FunctionTemplate_getFunction.phpt} (82%) rename tests/{V8FunctionTemplate_Set.phpt => V8FunctionTemplate_set.phpt} (66%) rename tests/{V8FunctionTemplate_SetCallHandler.phpt => V8FunctionTemplate_setCallHandler.phpt} (71%) delete mode 100644 tests/V8Isolate_ThrowException.phpt rename tests/{V8Isolate_GetEnteredContext.phpt => V8Isolate_getEnteredContext.phpt} (74%) rename tests/{V8Isolate_IsDead.phpt => V8Isolate_isDead.phpt} (73%) rename tests/{V8Isolate_IsInUse.phpt => V8Isolate_isInUse.phpt} (70%) create mode 100644 tests/V8Isolate_throwException.phpt rename tests/{V8Isolate_ThrowException_with_external.phpt => V8Isolate_throwException_with_external.phpt} (71%) rename tests/{V8ObjectTemplate_Set.phpt => V8ObjectTemplate_set.phpt} (72%) rename tests/{V8ObjectTemplate_SetAccessor_receiver.phpt => V8ObjectTemplate_setAccessor_receiver.phpt} (84%) rename tests/{V8ObjectTemplate_SetCallAsFunctionHandler.phpt => V8ObjectTemplate_setCallAsFunctionHandler.phpt} (78%) rename tests/{V8ObjectTemplate_SetHandlerForIndexedProperty.phpt => V8ObjectTemplate_setHandlerForIndexedProperty.phpt} (82%) rename tests/{V8ObjectTemplate_SetHandlerForNamedProperty.phpt => V8ObjectTemplate_setHandlerForNamedProperty.phpt} (73%) rename tests/{V8ObjectTemplate_SetHandler_both.phpt => V8ObjectTemplate_setHandler_both.phpt} (77%) rename tests/{V8ObjectTemplate_SetNativeDataProperty.phpt => V8ObjectTemplate_setNativeDataProperty.phpt} (68%) rename tests/{V8ObjectValue_Get.phpt => V8ObjectValue_get.phpt} (67%) rename tests/{V8ObjectValue_IsArgumentsObject.phpt => V8ObjectValue_isArgumentsObject.phpt} (63%) rename tests/{V8ObjectValue_IsNativeError.phpt => V8ObjectValue_isNativeError.phpt} (63%) rename tests/{V8ObjectValue_SetAccessor.phpt => V8ObjectValue_setAccessor.phpt} (62%) rename tests/{V8ObjectValue_SetIntegrityLevel.phpt => V8ObjectValue_setIntegrityLevel.phpt} (74%) rename tests/{V8ObjectValue_SetNativeDataProperty.phpt => V8ObjectValue_setNativeDataProperty.phpt} (71%) rename tests/{V8ObjectValue_SetNativeDataProperty_from_template.phpt => V8ObjectValue_setNativeDataProperty_from_template.phpt} (72%) rename tests/{V8ScriptCompiler_Compile.phpt => V8ScriptCompiler_compile.phpt} (73%) rename tests/{V8ScriptCompiler_CompileFunctionInContext.phpt => V8ScriptCompiler_compileFunctionInContext.phpt} (75%) rename tests/{V8ScriptCompiler_CompileUnbound.phpt => V8ScriptCompiler_compileUnbound.phpt} (71%) delete mode 100644 tests/V8Script_Run.phpt create mode 100644 tests/V8Script_run.phpt rename tests/{V8Script_Run_out_of_memory.phpt => V8Script_run_out_of_memory.phpt} (87%) rename tests/{V8Script_Run_uncaught_exception.phpt => V8Script_run_uncaught_exception.phpt} (83%) rename tests/{V8StackTrace_CurrentStackTrace.phpt => V8StackTrace_currentStackTrace.phpt} (91%) rename tests/{V8StartupData_CreateFromSource.phpt => V8StartupData_createFromSource.phpt} (74%) diff --git a/README.md b/README.md index 8268d44..41f6893 100644 --- a/README.md +++ b/README.md @@ -34,10 +34,6 @@ make any assumptions for you, so you stay in control, it does exactly what you a With php-v8 you can even implement nodejs in PHP. Not sure whether anyone should/will do this anyway, but it's doable. -*NOTE: Most, if not all, methods are named like in the V8 API - starting from capital letter. This PSR violation is done -intentionally with the purpose to provide a more solid experience between the native V8 C++ API and the V8 PHP API.* - - ## Demo Here is a [Hello World][v8-hello-world] @@ -50,9 +46,9 @@ $context = new \V8\Context($isolate); $source = new \V8\StringValue($isolate, "'Hello' + ', World!'"); $script = new \V8\Script($context, $source); -$result = $script->Run($context); +$result = $script->run($context); -echo $result->ToString($context)->Value(), PHP_EOL; +echo $result->toString($context)->value(), PHP_EOL; ``` which will output `Hello, World!`. See how it's shorter and more readable than [that C++ version][v8-hello-world]? diff --git a/src/php_v8_array.cc b/src/php_v8_array.cc index 07bc4ef..4c37d1f 100644 --- a/src/php_v8_array.cc +++ b/src/php_v8_array.cc @@ -25,7 +25,7 @@ zend_class_entry *php_v8_array_class_entry; #define this_ce php_v8_array_class_entry -static PHP_METHOD(V8Array, __construct) { +static PHP_METHOD(Array, __construct) { zval rv; zval *php_v8_context_zv; @@ -48,7 +48,7 @@ static PHP_METHOD(V8Array, __construct) { php_v8_value->persistent->Reset(isolate, local_array); } -static PHP_METHOD(V8Array, Length) { +static PHP_METHOD(Array, length) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -60,19 +60,19 @@ static PHP_METHOD(V8Array, Length) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_array___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_array___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_array_Length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_array_methods[] = { - PHP_ME(V8Array, __construct, arginfo_v8_array___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Array, __construct, arginfo_array___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Array, Length, arginfo_v8_array_Length, ZEND_ACC_PUBLIC) + PHP_ME(Array, length, arginfo_array_length, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_boolean.cc b/src/php_v8_boolean.cc index b7a4f14..047761e 100644 --- a/src/php_v8_boolean.cc +++ b/src/php_v8_boolean.cc @@ -23,7 +23,7 @@ zend_class_entry *php_v8_boolean_class_entry; #define this_ce php_v8_boolean_class_entry -static PHP_METHOD(V8BooleanValue, __construct) { +static PHP_METHOD(BooleanValue, __construct) { zval *php_v8_isolate_zv; zend_bool value = '\0'; @@ -41,7 +41,7 @@ static PHP_METHOD(V8BooleanValue, __construct) { php_v8_value->persistent->Reset(isolate, local_value); } -static PHP_METHOD(V8BooleanValue, Value) { +static PHP_METHOD(BooleanValue, value) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -55,18 +55,18 @@ static PHP_METHOD(V8BooleanValue, Value) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_boolean___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_boolean___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_TYPE_INFO(0, value, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_boolean_Value, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_boolean_value, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_boolean_methods[] = { - PHP_ME(V8BooleanValue, __construct, arginfo_v8_boolean___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8BooleanValue, Value, arginfo_v8_boolean_Value, ZEND_ACC_PUBLIC) + PHP_ME(BooleanValue, __construct, arginfo_boolean___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(BooleanValue, value, arginfo_boolean_value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_boolean_object.cc b/src/php_v8_boolean_object.cc index 5e4a01d..5b3f29a 100644 --- a/src/php_v8_boolean_object.cc +++ b/src/php_v8_boolean_object.cc @@ -24,7 +24,7 @@ zend_class_entry *php_v8_boolean_object_class_entry; #define this_ce php_v8_boolean_object_class_entry -static PHP_METHOD(V8BooleanObject, __construct) { +static PHP_METHOD(BooleanObject, __construct) { zval rv; zval *php_v8_context_zv; @@ -44,7 +44,7 @@ static PHP_METHOD(V8BooleanObject, __construct) { } -static PHP_METHOD(V8BooleanObject, ValueOf) { +static PHP_METHOD(BooleanObject, valueOf) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -58,19 +58,19 @@ static PHP_METHOD(V8BooleanObject, ValueOf) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_boolean_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_boolean_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_TYPE_INFO(0, value, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_boolean_object_ValueOf, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_boolean_object_valueOf, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_boolean_object_methods[] = { - PHP_ME(V8BooleanObject, __construct, arginfo_v8_boolean_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(BooleanObject, __construct, arginfo_boolean_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8BooleanObject, ValueOf, arginfo_v8_boolean_object_ValueOf, ZEND_ACC_PUBLIC) + PHP_ME(BooleanObject, valueOf, arginfo_boolean_object_valueOf, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_cached_data.cc b/src/php_v8_cached_data.cc index 32cc382..57ea7af 100644 --- a/src/php_v8_cached_data.cc +++ b/src/php_v8_cached_data.cc @@ -64,7 +64,7 @@ static zend_object * php_v8_cached_data_ctor(zend_class_entry *ce) return &php_v8_cached_data->std; } -static PHP_METHOD(V8CachedData, __construct) +static PHP_METHOD(CachedData, __construct) { zend_string *string = NULL; @@ -83,7 +83,7 @@ static PHP_METHOD(V8CachedData, __construct) php_v8_cached_data->cached_data = new v8::ScriptCompiler::CachedData(data, length, v8::ScriptCompiler::CachedData::BufferPolicy::BufferOwned); } -static PHP_METHOD(V8CachedData, GetData) +static PHP_METHOD(CachedData, getData) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -94,7 +94,7 @@ static PHP_METHOD(V8CachedData, GetData) RETVAL_STRINGL(reinterpret_cast(php_v8_cached_data->cached_data->data), php_v8_cached_data->cached_data->length); } -static PHP_METHOD(V8CachedData, IsRejected) +static PHP_METHOD(CachedData, isRejected) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -106,21 +106,21 @@ static PHP_METHOD(V8CachedData, IsRejected) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_cached_data___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_cached_data___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_cached_data_GetData, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_cached_data_getData, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_cached_data_IsRejected, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_cached_data_isRejected, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_cached_data_methods[] = { - PHP_ME(V8CachedData, __construct, arginfo_v8_cached_data___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8CachedData, GetData, arginfo_v8_cached_data_GetData, ZEND_ACC_PUBLIC) - PHP_ME(V8CachedData, IsRejected, arginfo_v8_cached_data_IsRejected, ZEND_ACC_PUBLIC) + PHP_ME(CachedData, __construct, arginfo_cached_data___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(CachedData, getData, arginfo_cached_data_getData, ZEND_ACC_PUBLIC) + PHP_ME(CachedData, isRejected, arginfo_cached_data_isRejected, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_callback_info.cc b/src/php_v8_callback_info.cc index 99e0f56..a9ee345 100644 --- a/src/php_v8_callback_info.cc +++ b/src/php_v8_callback_info.cc @@ -26,7 +26,7 @@ zend_class_entry *php_v8_callback_info_class_entry; static zend_object_handlers php_v8_callback_info_object_handlers; -static PHP_METHOD(V8CallbackInfo, GetIsolate) { +static PHP_METHOD(CallbackInfo, getIsolate) { zval rv; zval *tmp; @@ -38,7 +38,7 @@ static PHP_METHOD(V8CallbackInfo, GetIsolate) { ZVAL_COPY(return_value, tmp); } -static PHP_METHOD(V8CallbackInfo, GetContext) { +static PHP_METHOD(CallbackInfo, getContext) { zval rv; zval *tmp; @@ -50,7 +50,7 @@ static PHP_METHOD(V8CallbackInfo, GetContext) { ZVAL_COPY(return_value, tmp); } -static PHP_METHOD(V8CallbackInfo, This) { +static PHP_METHOD(CallbackInfo, this) { zval rv; zval *tmp; @@ -62,7 +62,7 @@ static PHP_METHOD(V8CallbackInfo, This) { ZVAL_COPY(return_value, tmp); } -static PHP_METHOD(V8CallbackInfo, Holder) { +static PHP_METHOD(CallbackInfo, holder) { zval rv; zval *tmp; @@ -74,7 +74,7 @@ static PHP_METHOD(V8CallbackInfo, Holder) { ZVAL_COPY(return_value, tmp); } -static PHP_METHOD(V8CallbackInfo, GetReturnValue) { +static PHP_METHOD(CallbackInfo, getReturnValue) { zval rv; zval *tmp; @@ -86,27 +86,27 @@ static PHP_METHOD(V8CallbackInfo, GetReturnValue) { ZVAL_COPY(return_value, tmp); } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_callback_info_GetIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_callback_info_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_callback_info_GetContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_callback_info_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_callback_info_This, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_callback_info_this, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_callback_info_Holder, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_callback_info_holder, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_callback_info_GetReturnValue, ZEND_RETURN_VALUE, 0, V8\\ReturnValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_callback_info_getReturnValue, ZEND_RETURN_VALUE, 0, V8\\ReturnValue, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_callback_info_methods[] = { - PHP_ME(V8CallbackInfo, This, arginfo_v8_callback_info_This, ZEND_ACC_PUBLIC) - PHP_ME(V8CallbackInfo, Holder, arginfo_v8_callback_info_Holder, ZEND_ACC_PUBLIC) - PHP_ME(V8CallbackInfo, GetIsolate, arginfo_v8_callback_info_GetIsolate, ZEND_ACC_PUBLIC) - PHP_ME(V8CallbackInfo, GetContext, arginfo_v8_callback_info_GetContext, ZEND_ACC_PUBLIC) - PHP_ME(V8CallbackInfo, GetReturnValue, arginfo_v8_callback_info_GetReturnValue, ZEND_ACC_PUBLIC) + PHP_ME(CallbackInfo, this, arginfo_callback_info_this, ZEND_ACC_PUBLIC) + PHP_ME(CallbackInfo, holder, arginfo_callback_info_holder, ZEND_ACC_PUBLIC) + PHP_ME(CallbackInfo, getIsolate, arginfo_callback_info_getIsolate, ZEND_ACC_PUBLIC) + PHP_ME(CallbackInfo, getContext, arginfo_callback_info_getContext, ZEND_ACC_PUBLIC) + PHP_ME(CallbackInfo, getReturnValue, arginfo_callback_info_getReturnValue, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_context.cc b/src/php_v8_context.cc index cac542b..617f407 100644 --- a/src/php_v8_context.cc +++ b/src/php_v8_context.cc @@ -79,7 +79,7 @@ php_v8_context_t * php_v8_context_get_reference(v8::Local context) } -static PHP_METHOD(V8Context, __construct) +static PHP_METHOD(Context, __construct) { zval *php_v8_isolate_zv; zval *php_v8_global_template_zv = NULL; @@ -123,7 +123,7 @@ static PHP_METHOD(V8Context, __construct) php_v8_context->context->Reset(isolate, context); } -static PHP_METHOD(V8Context, GetIsolate) +static PHP_METHOD(Context, getIsolate) { zval rv; @@ -136,7 +136,7 @@ static PHP_METHOD(V8Context, GetIsolate) RETVAL_ZVAL(PHP_V8_CONTEXT_READ_ISOLATE(getThis()), 1, 0); } -static PHP_METHOD(V8Context, GlobalObject) +static PHP_METHOD(Context, globalObject) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -151,7 +151,7 @@ static PHP_METHOD(V8Context, GlobalObject) php_v8_get_or_create_value(return_value, local_object, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Context, DetachGlobal) +static PHP_METHOD(Context, detachGlobal) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -164,7 +164,7 @@ static PHP_METHOD(V8Context, DetachGlobal) context->DetachGlobal(); } -static PHP_METHOD(V8Context, SetSecurityToken) +static PHP_METHOD(Context, setSecurityToken) { zval *php_v8_value_zv; @@ -184,7 +184,7 @@ static PHP_METHOD(V8Context, SetSecurityToken) context->SetSecurityToken(local_token); } -static PHP_METHOD(V8Context, UseDefaultSecurityToken) +static PHP_METHOD(Context, useDefaultSecurityToken) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -197,7 +197,7 @@ static PHP_METHOD(V8Context, UseDefaultSecurityToken) context->UseDefaultSecurityToken(); } -static PHP_METHOD(V8Context, GetSecurityToken) +static PHP_METHOD(Context, getSecurityToken) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -213,7 +213,7 @@ static PHP_METHOD(V8Context, GetSecurityToken) php_v8_get_or_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Context, AllowCodeGenerationFromStrings) +static PHP_METHOD(Context, allowCodeGenerationFromStrings) { zend_bool allow = '\1'; @@ -228,7 +228,7 @@ static PHP_METHOD(V8Context, AllowCodeGenerationFromStrings) context->AllowCodeGenerationFromStrings((bool) allow); } -static PHP_METHOD(V8Context, IsCodeGenerationFromStringsAllowed) +static PHP_METHOD(Context, isCodeGenerationFromStringsAllowed) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -241,7 +241,7 @@ static PHP_METHOD(V8Context, IsCodeGenerationFromStringsAllowed) RETURN_BOOL(context->IsCodeGenerationFromStringsAllowed()); } -static PHP_METHOD(V8Context, SetErrorMessageForCodeGenerationFromStrings) +static PHP_METHOD(Context, setErrorMessageForCodeGenerationFromStrings) { zval *php_v8_string_zv; @@ -262,63 +262,63 @@ static PHP_METHOD(V8Context, SetErrorMessageForCodeGenerationFromStrings) context->SetErrorMessageForCodeGenerationFromStrings(local_string); } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_context___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_context___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_OBJ_INFO(0, global_template, V8\\ObjectTemplate, 1) ZEND_ARG_OBJ_INFO(0, global_object, V8\\ObjectValue, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_context_GetIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_context_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_context_GlobalObject, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_context_globalObject, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_context_DetachGlobal, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_context_detachGlobal, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_context_SetSecurityToken, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_context_setSecurityToken, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, token, V8\\Value, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_context_UseDefaultSecurityToken, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_context_useDefaultSecurityToken, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_context_GetSecurityToken, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_context_getSecurityToken, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_context_AllowCodeGenerationFromStrings, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_context_allowCodeGenerationFromStrings, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, allow, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_context_IsCodeGenerationFromStringsAllowed, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_context_isCodeGenerationFromStringsAllowed, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_context_SetErrorMessageForCodeGenerationFromStrings, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_context_setErrorMessageForCodeGenerationFromStrings, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, message, V8\\StringValue, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_context_methods[] = { - PHP_ME(V8Context, __construct, arginfo_v8_context___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Context, GetIsolate, arginfo_v8_context_GetIsolate, ZEND_ACC_PUBLIC) + PHP_ME(Context, __construct, arginfo_context___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Context, getIsolate, arginfo_context_getIsolate, ZEND_ACC_PUBLIC) - PHP_ME(V8Context, GlobalObject, arginfo_v8_context_GlobalObject, ZEND_ACC_PUBLIC) - PHP_ME(V8Context, DetachGlobal, arginfo_v8_context_DetachGlobal, ZEND_ACC_PUBLIC) + PHP_ME(Context, globalObject, arginfo_context_globalObject, ZEND_ACC_PUBLIC) + PHP_ME(Context, detachGlobal, arginfo_context_detachGlobal, ZEND_ACC_PUBLIC) - PHP_ME(V8Context, SetSecurityToken, arginfo_v8_context_SetSecurityToken, ZEND_ACC_PUBLIC) - PHP_ME(V8Context, UseDefaultSecurityToken, arginfo_v8_context_UseDefaultSecurityToken, ZEND_ACC_PUBLIC) - PHP_ME(V8Context, GetSecurityToken, arginfo_v8_context_GetSecurityToken, ZEND_ACC_PUBLIC) + PHP_ME(Context, setSecurityToken, arginfo_context_setSecurityToken, ZEND_ACC_PUBLIC) + PHP_ME(Context, useDefaultSecurityToken, arginfo_context_useDefaultSecurityToken, ZEND_ACC_PUBLIC) + PHP_ME(Context, getSecurityToken, arginfo_context_getSecurityToken, ZEND_ACC_PUBLIC) - PHP_ME(V8Context, AllowCodeGenerationFromStrings, arginfo_v8_context_AllowCodeGenerationFromStrings, ZEND_ACC_PUBLIC) - PHP_ME(V8Context, IsCodeGenerationFromStringsAllowed, arginfo_v8_context_IsCodeGenerationFromStringsAllowed, ZEND_ACC_PUBLIC) - PHP_ME(V8Context, SetErrorMessageForCodeGenerationFromStrings, arginfo_v8_context_SetErrorMessageForCodeGenerationFromStrings, ZEND_ACC_PUBLIC) + PHP_ME(Context, allowCodeGenerationFromStrings, arginfo_context_allowCodeGenerationFromStrings, ZEND_ACC_PUBLIC) + PHP_ME(Context, isCodeGenerationFromStringsAllowed, arginfo_context_isCodeGenerationFromStringsAllowed, ZEND_ACC_PUBLIC) + PHP_ME(Context, setErrorMessageForCodeGenerationFromStrings, arginfo_context_setErrorMessageForCodeGenerationFromStrings, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_date.cc b/src/php_v8_date.cc index 0bb3289..7033b4b 100644 --- a/src/php_v8_date.cc +++ b/src/php_v8_date.cc @@ -24,7 +24,7 @@ zend_class_entry *php_v8_date_class_entry; #define this_ce php_v8_date_class_entry -static PHP_METHOD(V8Date, __construct) { +static PHP_METHOD(Date, __construct) { zval rv; zval *php_v8_context_zv; @@ -48,7 +48,7 @@ static PHP_METHOD(V8Date, __construct) { } -static PHP_METHOD(V8Date, ValueOf) { +static PHP_METHOD(Date, valueOf) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -59,7 +59,7 @@ static PHP_METHOD(V8Date, ValueOf) { RETURN_DOUBLE(php_v8_value_get_local_as(php_v8_value)->ValueOf()); } -static PHP_METHOD(V8Date, DateTimeConfigurationChangeNotification) { +static PHP_METHOD(Date, dateTimeConfigurationChangeNotification) { zval *isolate_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &isolate_zv) == FAILURE) { @@ -72,26 +72,26 @@ static PHP_METHOD(V8Date, DateTimeConfigurationChangeNotification) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_date___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_date___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_TYPE_INFO(0, time, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_date_ValueOf, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_date_valueOf, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_date_DateTimeConfigurationChangeNotification, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_date_dateTimeConfigurationChangeNotification, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\isolate, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_date_methods[] = { - PHP_ME(V8Date, __construct, arginfo_v8_date___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Date, __construct, arginfo_date___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Date, ValueOf, arginfo_v8_date_ValueOf, ZEND_ACC_PUBLIC) + PHP_ME(Date, valueOf, arginfo_date_valueOf, ZEND_ACC_PUBLIC) - PHP_ME(V8Date, DateTimeConfigurationChangeNotification, arginfo_v8_date_DateTimeConfigurationChangeNotification, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Date, dateTimeConfigurationChangeNotification, arginfo_date_dateTimeConfigurationChangeNotification, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/src/php_v8_exception.cc b/src/php_v8_exception.cc index 8425076..56ccd0d 100644 --- a/src/php_v8_exception.cc +++ b/src/php_v8_exception.cc @@ -26,7 +26,7 @@ zend_class_entry *php_v8_exception_class_entry; #define this_ce php_v8_exception_class_entry -static PHP_METHOD(V8Exception, RangeError) { +static PHP_METHOD(Exception, rangeError) { zval *php_v8_message_zv; zval *php_v8_context_zv; @@ -49,7 +49,7 @@ static PHP_METHOD(V8Exception, RangeError) { php_v8_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Exception, ReferenceError) { +static PHP_METHOD(Exception, referenceError) { zval *php_v8_message_zv; zval *php_v8_context_zv; @@ -72,7 +72,7 @@ static PHP_METHOD(V8Exception, ReferenceError) { php_v8_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Exception, SyntaxError) { +static PHP_METHOD(Exception, syntaxError) { zval *php_v8_message_zv; zval *php_v8_context_zv; @@ -95,7 +95,7 @@ static PHP_METHOD(V8Exception, SyntaxError) { php_v8_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Exception, TypeError) { +static PHP_METHOD(Exception, typeError) { zval *php_v8_message_zv; zval *php_v8_context_zv; @@ -117,7 +117,7 @@ static PHP_METHOD(V8Exception, TypeError) { php_v8_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Exception, Error) { +static PHP_METHOD(Exception, error) { zval *php_v8_message_zv; zval *php_v8_context_zv; @@ -140,7 +140,7 @@ static PHP_METHOD(V8Exception, Error) { php_v8_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Exception, CreateMessage) { +static PHP_METHOD(Exception, createMessage) { zval *php_v8_context_zv; zval *php_v8_exception_zv; @@ -163,7 +163,7 @@ static PHP_METHOD(V8Exception, CreateMessage) { php_v8_message_create_from_message(return_value, php_v8_context->php_v8_isolate, local_message); } -static PHP_METHOD(V8Exception, GetStackTrace) { +static PHP_METHOD(Exception, getStackTrace) { zval *php_v8_exception_zv; zval *php_v8_context_zv; @@ -191,50 +191,50 @@ static PHP_METHOD(V8Exception, GetStackTrace) { } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_exception_RangeError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_rangeError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, message, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_exception_ReferenceError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_referenceError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, message, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_exception_SyntaxError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_syntaxError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, message, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_exception_TypeError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_typeError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, message, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_exception_Error, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_error, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, message, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_exception_CreateMessage, ZEND_RETURN_VALUE, 2, V8\\Message, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_createMessage, ZEND_RETURN_VALUE, 2, V8\\Message, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, exception, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_exception_GetStackTrace, ZEND_RETURN_VALUE, 2, V8\\StackTrace, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_getStackTrace, ZEND_RETURN_VALUE, 2, V8\\StackTrace, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, exception, V8\\Value, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_exception_methods[] = { - PHP_ME(V8Exception, RangeError, arginfo_v8_exception_RangeError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Exception, ReferenceError, arginfo_v8_exception_ReferenceError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Exception, SyntaxError, arginfo_v8_exception_SyntaxError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Exception, TypeError, arginfo_v8_exception_TypeError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Exception, Error, arginfo_v8_exception_Error, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - - PHP_ME(V8Exception, CreateMessage, arginfo_v8_exception_CreateMessage, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Exception, GetStackTrace, arginfo_v8_exception_GetStackTrace, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Exception, rangeError, arginfo_exception_rangeError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Exception, referenceError, arginfo_exception_referenceError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Exception, syntaxError, arginfo_exception_syntaxError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Exception, typeError, arginfo_exception_typeError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Exception, error, arginfo_exception_error, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + + PHP_ME(Exception, createMessage, arginfo_exception_createMessage, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Exception, getStackTrace, arginfo_exception_getStackTrace, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/src/php_v8_exceptions.cc b/src/php_v8_exceptions.cc index 324e316..9acf5a1 100644 --- a/src/php_v8_exceptions.cc +++ b/src/php_v8_exceptions.cc @@ -90,7 +90,7 @@ void php_v8_create_try_catch_exception(zval *return_value, php_v8_isolate_t *php } -static PHP_METHOD(V8ExceptionsTryCatch, __construct) +static PHP_METHOD(ExceptionsTryCatch, __construct) { zval rv; @@ -120,7 +120,7 @@ static PHP_METHOD(V8ExceptionsTryCatch, __construct) PHP_V8_TRY_CATCH_EXCEPTION_STORE_TRY_CATCH(getThis(), try_catch_zv); } -static PHP_METHOD(V8ExceptionsTryCatch, GetIsolate) +static PHP_METHOD(ExceptionsTryCatch, getIsolate) { zval rv; @@ -131,7 +131,7 @@ static PHP_METHOD(V8ExceptionsTryCatch, GetIsolate) RETVAL_ZVAL(PHP_V8_TRY_CATCH_EXCEPTION_READ_ISOLATE(getThis()), 1, 0); } -static PHP_METHOD(V8ExceptionsTryCatch, GetContext) +static PHP_METHOD(ExceptionsTryCatch, getContext) { zval rv; @@ -142,7 +142,7 @@ static PHP_METHOD(V8ExceptionsTryCatch, GetContext) RETVAL_ZVAL(PHP_V8_TRY_CATCH_EXCEPTION_READ_CONTEXT(getThis()), 1, 0); } -static PHP_METHOD(V8ExceptionsTryCatch, GetTryCatch) +static PHP_METHOD(ExceptionsTryCatch, getTryCatch) { zval rv; @@ -154,19 +154,19 @@ static PHP_METHOD(V8ExceptionsTryCatch, GetTryCatch) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_exceptions_try_catch___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 3) +ZEND_BEGIN_ARG_INFO_EX(arginfo_exceptions_try_catch___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 3) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, try_catch, V8\\TryCatch, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_exceptions_try_catch_GetIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exceptions_try_catch_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_exceptions_try_catch_GetContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exceptions_try_catch_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_exceptions_try_catch_GetTryCatch, ZEND_RETURN_VALUE, 0, V8\\TryCatch, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exceptions_try_catch_getTryCatch, ZEND_RETURN_VALUE, 0, V8\\TryCatch, 0) ZEND_END_ARG_INFO() @@ -176,11 +176,11 @@ static const zend_function_entry php_v8_exception_methods[] = { }; static const zend_function_entry php_v8_try_catch_exception_methods[] = { - PHP_ME(V8ExceptionsTryCatch, __construct, arginfo_v8_exceptions_try_catch___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(ExceptionsTryCatch, __construct, arginfo_exceptions_try_catch___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8ExceptionsTryCatch, GetIsolate, arginfo_v8_exceptions_try_catch_GetIsolate, ZEND_ACC_PUBLIC) - PHP_ME(V8ExceptionsTryCatch, GetContext, arginfo_v8_exceptions_try_catch_GetContext, ZEND_ACC_PUBLIC) - PHP_ME(V8ExceptionsTryCatch, GetTryCatch, arginfo_v8_exceptions_try_catch_GetTryCatch, ZEND_ACC_PUBLIC) + PHP_ME(ExceptionsTryCatch, getIsolate, arginfo_exceptions_try_catch_getIsolate, ZEND_ACC_PUBLIC) + PHP_ME(ExceptionsTryCatch, getContext, arginfo_exceptions_try_catch_getContext, ZEND_ACC_PUBLIC) + PHP_ME(ExceptionsTryCatch, getTryCatch, arginfo_exceptions_try_catch_getTryCatch, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_ext_mem_interface.cc b/src/php_v8_ext_mem_interface.cc index 7d57ee3..cb65532 100644 --- a/src/php_v8_ext_mem_interface.cc +++ b/src/php_v8_ext_mem_interface.cc @@ -91,18 +91,18 @@ void php_v8_ext_mem_interface_object_template_GetExternalAllocatedMemory(INTERNA } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_ext_mem_interface_AdjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_ext_mem_interface_adjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, change_in_bytes, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_ext_mem_interface_GetExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_ext_mem_interface_getExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_ext_mem_interface_methods[] = { - PHP_ABSTRACT_ME(V8AdjustableExternalMemoryInterface, AdjustExternalAllocatedMemory, arginfo_php_v8_ext_mem_interface_AdjustExternalAllocatedMemory) - PHP_ABSTRACT_ME(V8AdjustableExternalMemoryInterface, GetExternalAllocatedMemory, arginfo_php_v8_ext_mem_interface_GetExternalAllocatedMemory) + PHP_ABSTRACT_ME(AdjustableExternalMemoryInterface, adjustExternalAllocatedMemory, arginfo_php_v8_ext_mem_interface_adjustExternalAllocatedMemory) + PHP_ABSTRACT_ME(AdjustableExternalMemoryInterface, getExternalAllocatedMemory, arginfo_php_v8_ext_mem_interface_getExternalAllocatedMemory) PHP_FE_END }; diff --git a/src/php_v8_function.cc b/src/php_v8_function.cc index 9835e68..9adcde5 100644 --- a/src/php_v8_function.cc +++ b/src/php_v8_function.cc @@ -283,7 +283,7 @@ bool php_v8_function_unpack_object_args(zval* arguments_zv, int arg_position, v8 } -static PHP_METHOD(V8Function, __construct) { +static PHP_METHOD(Function, __construct) { zval rv; zval *php_v8_context_zv; @@ -343,7 +343,7 @@ static PHP_METHOD(V8Function, __construct) { php_v8_value->persistent->Reset(isolate, local_function); } -static PHP_METHOD(V8Function, NewInstance) { +static PHP_METHOD(Function, newInstance) { zval *php_v8_context_zv; zval *arguments_zv = NULL; @@ -386,7 +386,7 @@ static PHP_METHOD(V8Function, NewInstance) { php_v8_get_or_create_value(return_value, local_obj, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Function, Call) { +static PHP_METHOD(Function, call) { zval *php_v8_context_zv; zval *php_v8_recv_zv; zval *arguments_zv = NULL; @@ -432,7 +432,7 @@ static PHP_METHOD(V8Function, Call) { php_v8_get_or_create_value(return_value, local_res, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Function, SetName) { +static PHP_METHOD(Function, setName) { zval *php_v8_string_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_string_zv) == FAILURE) { @@ -453,7 +453,7 @@ static PHP_METHOD(V8Function, SetName) { local_function->SetName(local_name); } -static PHP_METHOD(V8Function, GetName) { +static PHP_METHOD(Function, getName) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -468,7 +468,7 @@ static PHP_METHOD(V8Function, GetName) { php_v8_get_or_create_value(return_value, local_name, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Function, GetInferredName) { +static PHP_METHOD(Function, getInferredName) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -484,7 +484,7 @@ static PHP_METHOD(V8Function, GetInferredName) { } -static PHP_METHOD(V8Function, GetDisplayName) { +static PHP_METHOD(Function, getDisplayName) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -499,7 +499,7 @@ static PHP_METHOD(V8Function, GetDisplayName) { php_v8_get_or_create_value(return_value, local_display_name, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Function, GetScriptLineNumber) { +static PHP_METHOD(Function, getScriptLineNumber) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -520,7 +520,7 @@ static PHP_METHOD(V8Function, GetScriptLineNumber) { RETURN_LONG((zend_long) line_number); } -static PHP_METHOD(V8Function, GetScriptColumnNumber) { +static PHP_METHOD(Function, getScriptColumnNumber) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -541,7 +541,7 @@ static PHP_METHOD(V8Function, GetScriptColumnNumber) { RETURN_LONG((zend_long) column_number); } -static PHP_METHOD(V8Function, GetBoundFunction) { +static PHP_METHOD(Function, getBoundFunction) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -557,7 +557,7 @@ static PHP_METHOD(V8Function, GetBoundFunction) { php_v8_get_or_create_value(return_value, local_value, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Function, GetScriptOrigin) { +static PHP_METHOD(Function, getScriptOrigin) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -574,65 +574,65 @@ static PHP_METHOD(V8Function, GetScriptOrigin) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_function___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_function___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_CALLABLE_INFO(0, callback, 0) ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_function_NewInstance, ZEND_RETURN_VALUE, 1, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_newInstance, ZEND_RETURN_VALUE, 1, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_ARRAY_INFO(0, arguments, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_function_Call, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_call, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, recv, V8\\Value, 0) ZEND_ARG_ARRAY_INFO(0, arguments, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_function_SetName, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_function_setName, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, name, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_function_GetName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_getName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_function_GetInferredName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_getInferredName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_function_GetDisplayName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_getDisplayName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() // long or null -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_function_GetScriptLineNumber, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_function_getScriptLineNumber, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() // long or null -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_function_GetScriptColumnNumber, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_function_getScriptColumnNumber, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_function_GetBoundFunction, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_getBoundFunction, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_function_GetScriptOrigin, ZEND_RETURN_VALUE, 0, V8\\ScriptOrigin, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_getScriptOrigin, ZEND_RETURN_VALUE, 0, V8\\ScriptOrigin, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_object_methods[] = { - PHP_ME(V8Function, __construct, arginfo_v8_function___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Function, NewInstance, arginfo_v8_function_NewInstance, ZEND_ACC_PUBLIC) - PHP_ME(V8Function, Call, arginfo_v8_function_Call, ZEND_ACC_PUBLIC) - PHP_ME(V8Function, SetName, arginfo_v8_function_SetName, ZEND_ACC_PUBLIC) - PHP_ME(V8Function, GetName, arginfo_v8_function_GetName, ZEND_ACC_PUBLIC) - PHP_ME(V8Function, GetInferredName, arginfo_v8_function_GetInferredName, ZEND_ACC_PUBLIC) - PHP_ME(V8Function, GetDisplayName, arginfo_v8_function_GetDisplayName, ZEND_ACC_PUBLIC) - - PHP_ME(V8Function, GetScriptLineNumber, arginfo_v8_function_GetScriptLineNumber, ZEND_ACC_PUBLIC) - PHP_ME(V8Function, GetScriptColumnNumber, arginfo_v8_function_GetScriptColumnNumber, ZEND_ACC_PUBLIC) - - PHP_ME(V8Function, GetBoundFunction, arginfo_v8_function_GetBoundFunction, ZEND_ACC_PUBLIC) - PHP_ME(V8Function, GetScriptOrigin, arginfo_v8_function_GetScriptOrigin, ZEND_ACC_PUBLIC) + PHP_ME(Function, __construct, arginfo_function___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Function, newInstance, arginfo_function_newInstance, ZEND_ACC_PUBLIC) + PHP_ME(Function, call, arginfo_function_call, ZEND_ACC_PUBLIC) + PHP_ME(Function, setName, arginfo_function_setName, ZEND_ACC_PUBLIC) + PHP_ME(Function, getName, arginfo_function_getName, ZEND_ACC_PUBLIC) + PHP_ME(Function, getInferredName, arginfo_function_getInferredName, ZEND_ACC_PUBLIC) + PHP_ME(Function, getDisplayName, arginfo_function_getDisplayName, ZEND_ACC_PUBLIC) + + PHP_ME(Function, getScriptLineNumber, arginfo_function_getScriptLineNumber, ZEND_ACC_PUBLIC) + PHP_ME(Function, getScriptColumnNumber, arginfo_function_getScriptColumnNumber, ZEND_ACC_PUBLIC) + + PHP_ME(Function, getBoundFunction, arginfo_function_getBoundFunction, ZEND_ACC_PUBLIC) + PHP_ME(Function, getScriptOrigin, arginfo_function_getScriptOrigin, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_function_callback_info.cc b/src/php_v8_function_callback_info.cc index 6a92b78..4c152dc 100644 --- a/src/php_v8_function_callback_info.cc +++ b/src/php_v8_function_callback_info.cc @@ -86,7 +86,7 @@ php_v8_return_value_t * php_v8_callback_info_create_from_info(zval *return_value return php_v8_return_value; } -static PHP_METHOD(V8FunctionCallbackInfo, Length) { +static PHP_METHOD(FunctionCallbackInfo, length) { zval rv; zval *tmp; @@ -99,7 +99,7 @@ static PHP_METHOD(V8FunctionCallbackInfo, Length) { RETURN_LONG(zend_array_count(Z_ARRVAL_P(tmp))); } -static PHP_METHOD(V8FunctionCallbackInfo, Arguments) { +static PHP_METHOD(FunctionCallbackInfo, arguments) { zval rv; zval *tmp; @@ -111,7 +111,7 @@ static PHP_METHOD(V8FunctionCallbackInfo, Arguments) { ZVAL_COPY(return_value, tmp); } -static PHP_METHOD(V8FunctionCallbackInfo, NewTarget) { +static PHP_METHOD(FunctionCallbackInfo, newTarget) { zval rv; zval *tmp; @@ -123,7 +123,7 @@ static PHP_METHOD(V8FunctionCallbackInfo, NewTarget) { ZVAL_COPY(return_value, tmp); } -static PHP_METHOD(V8FunctionCallbackInfo, IsConstructCall) { +static PHP_METHOD(FunctionCallbackInfo, isConstructCall) { zval rv; zval *tmp; @@ -136,24 +136,24 @@ static PHP_METHOD(V8FunctionCallbackInfo, IsConstructCall) { } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_function_callback_info_Length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_function_callback_info_length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_function_callback_info_Arguments, ZEND_RETURN_VALUE, 0, IS_ARRAY, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_function_callback_info_arguments, ZEND_RETURN_VALUE, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_function_callback_info_NewTarget, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_callback_info_newTarget, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_function_callback_info_IsConstructCall, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_function_callback_info_isConstructCall, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_function_callback_info_methods[] = { - PHP_ME(V8FunctionCallbackInfo, Length, arginfo_v8_function_callback_info_Length, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionCallbackInfo, Arguments, arginfo_v8_function_callback_info_Arguments, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionCallbackInfo, NewTarget, arginfo_v8_function_callback_info_NewTarget, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionCallbackInfo, IsConstructCall, arginfo_v8_function_callback_info_IsConstructCall, ZEND_ACC_PUBLIC) + PHP_ME(FunctionCallbackInfo, length, arginfo_function_callback_info_length, ZEND_ACC_PUBLIC) + PHP_ME(FunctionCallbackInfo, arguments, arginfo_function_callback_info_arguments, ZEND_ACC_PUBLIC) + PHP_ME(FunctionCallbackInfo, newTarget, arginfo_function_callback_info_newTarget, ZEND_ACC_PUBLIC) + PHP_ME(FunctionCallbackInfo, isConstructCall, arginfo_function_callback_info_isConstructCall, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_function_template.cc b/src/php_v8_function_template.cc index 8d9df53..90ef68a 100644 --- a/src/php_v8_function_template.cc +++ b/src/php_v8_function_template.cc @@ -125,7 +125,7 @@ static zend_object * php_v8_function_template_ctor(zend_class_entry *ce) { } -static PHP_METHOD(V8FunctionTemplate, __construct) { +static PHP_METHOD(FunctionTemplate, __construct) { zval *php_v8_isolate_zv; zend_fcall_info fci = empty_fcall_info; @@ -185,7 +185,7 @@ static PHP_METHOD(V8FunctionTemplate, __construct) { } -static PHP_METHOD(V8FunctionTemplate, GetIsolate) { +static PHP_METHOD(FunctionTemplate, getIsolate) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -199,21 +199,21 @@ static PHP_METHOD(V8FunctionTemplate, GetIsolate) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static PHP_METHOD(V8FunctionTemplate, Set) { +static PHP_METHOD(FunctionTemplate, set) { php_v8_function_template_Set(INTERNAL_FUNCTION_PARAM_PASSTHRU); } -static PHP_METHOD(V8FunctionTemplate, SetAccessorProperty) { +static PHP_METHOD(FunctionTemplate, setAccessorProperty) { php_v8_function_template_SetAccessorProperty(INTERNAL_FUNCTION_PARAM_PASSTHRU); } -static PHP_METHOD(V8FunctionTemplate, SetNativeDataProperty) { +static PHP_METHOD(FunctionTemplate, setNativeDataProperty) { php_v8_function_template_SetNativeDataProperty(INTERNAL_FUNCTION_PARAM_PASSTHRU); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static PHP_METHOD(V8FunctionTemplate, GetFunction) { +static PHP_METHOD(FunctionTemplate, getFunction) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -238,7 +238,7 @@ static PHP_METHOD(V8FunctionTemplate, GetFunction) { php_v8_get_or_create_value(return_value, local_function, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8FunctionTemplate, SetCallHandler) { +static PHP_METHOD(FunctionTemplate, setCallHandler) { zend_fcall_info fci = empty_fcall_info; zend_fcall_info_cache fci_cache = empty_fcall_info_cache; @@ -261,7 +261,7 @@ static PHP_METHOD(V8FunctionTemplate, SetCallHandler) { local_template->SetCallHandler(php_v8_callback_function, v8::External::New(isolate, bucket)); } -static PHP_METHOD(V8FunctionTemplate, SetLength) { +static PHP_METHOD(FunctionTemplate, setLength) { zend_long length; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &length) == FAILURE) { @@ -278,7 +278,7 @@ static PHP_METHOD(V8FunctionTemplate, SetLength) { local_template->SetLength(static_cast(length)); } -static PHP_METHOD(V8FunctionTemplate, InstanceTemplate) { +static PHP_METHOD(FunctionTemplate, instanceTemplate) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -301,7 +301,7 @@ static PHP_METHOD(V8FunctionTemplate, InstanceTemplate) { return_php_v8_object_template->persistent->Reset(isolate, local_obj_tpl); } -static PHP_METHOD(V8FunctionTemplate, Inherit) { +static PHP_METHOD(FunctionTemplate, inherit) { zval *parent_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &parent_zv) == FAILURE) { @@ -319,7 +319,7 @@ static PHP_METHOD(V8FunctionTemplate, Inherit) { local_template->Inherit(local_template_parent); } -static PHP_METHOD(V8FunctionTemplate, PrototypeTemplate) { +static PHP_METHOD(FunctionTemplate, prototypeTemplate) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -342,7 +342,7 @@ static PHP_METHOD(V8FunctionTemplate, PrototypeTemplate) { return_php_v8_object_template->persistent->Reset(isolate, local_obj_tpl); } -static PHP_METHOD(V8FunctionTemplate, SetClassName) { +static PHP_METHOD(FunctionTemplate, setClassName) { zval *php_v8_string_zv = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_string_zv) == FAILURE) { @@ -362,7 +362,7 @@ static PHP_METHOD(V8FunctionTemplate, SetClassName) { local_function_tpl->SetClassName(local_name); } -static PHP_METHOD(V8FunctionTemplate, SetAcceptAnyReceiver) { +static PHP_METHOD(FunctionTemplate, setAcceptAnyReceiver) { zend_bool value; if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &value) == FAILURE) { @@ -378,7 +378,7 @@ static PHP_METHOD(V8FunctionTemplate, SetAcceptAnyReceiver) { local_template->SetAcceptAnyReceiver(static_cast(value)); } -static PHP_METHOD(V8FunctionTemplate, SetHiddenPrototype) { +static PHP_METHOD(FunctionTemplate, setHiddenPrototype) { zend_bool value; if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &value) == FAILURE) { @@ -393,7 +393,7 @@ static PHP_METHOD(V8FunctionTemplate, SetHiddenPrototype) { local_template->SetHiddenPrototype(static_cast(value)); } -static PHP_METHOD(V8FunctionTemplate, ReadOnlyPrototype) { +static PHP_METHOD(FunctionTemplate, readOnlyPrototype) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -407,7 +407,7 @@ static PHP_METHOD(V8FunctionTemplate, ReadOnlyPrototype) { local_function_tpl->ReadOnlyPrototype(); } -static PHP_METHOD(V8FunctionTemplate, RemovePrototype) { +static PHP_METHOD(FunctionTemplate, removePrototype) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -421,7 +421,7 @@ static PHP_METHOD(V8FunctionTemplate, RemovePrototype) { local_function_tpl->RemovePrototype(); } -static PHP_METHOD(V8FunctionTemplate, HasInstance) { +static PHP_METHOD(FunctionTemplate, hasInstance) { zval *object_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &object_zv) == FAILURE) { @@ -440,17 +440,17 @@ static PHP_METHOD(V8FunctionTemplate, HasInstance) { } /* Non-standard, implementations of AdjustableExternalMemoryInterface::AdjustExternalAllocatedMemory */ -static PHP_METHOD(V8FunctionTemplate, AdjustExternalAllocatedMemory) { +static PHP_METHOD(FunctionTemplate, adjustExternalAllocatedMemory) { php_v8_ext_mem_interface_function_template_AdjustExternalAllocatedMemory(INTERNAL_FUNCTION_PARAM_PASSTHRU); } /* Non-standard, implementations of AdjustableExternalMemoryInterface::GetExternalAllocatedMemory */ -static PHP_METHOD(V8FunctionTemplate, GetExternalAllocatedMemory) { +static PHP_METHOD(FunctionTemplate, getExternalAllocatedMemory) { php_v8_ext_mem_interface_function_template_GetExternalAllocatedMemory(INTERNAL_FUNCTION_PARAM_PASSTHRU); } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_function_template___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_CALLABLE_INFO(0, callback, 1) ZEND_ARG_OBJ_INFO(0, receiver, V8\\FunctionTemplate, 1) @@ -458,18 +458,18 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_function_template___construct, ZEND_SEND_BY_VA ZEND_ARG_TYPE_INFO(0, behavior, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_function_template_GetIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_template_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_Set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Data, 0) ZEND_ARG_TYPE_INFO(0, attributes, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_SetAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_setAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, getter, V8\\FunctionTemplate, 0) ZEND_ARG_OBJ_INFO(0, setter, V8\\FunctionTemplate, 0) @@ -477,7 +477,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_SetAccessorProperty, ZEN ZEND_ARG_TYPE_INFO(0, settings, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_SetNativeDataProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_setNativeDataProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_CALLABLE_INFO(0, getter, 0) ZEND_ARG_CALLABLE_INFO(0, setter, 1) @@ -488,90 +488,90 @@ ZEND_END_ARG_INFO() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_function_template_GetFunction, ZEND_RETURN_VALUE, 1, V8\\FunctionObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_function_template_getFunction, ZEND_RETURN_VALUE, 1, V8\\FunctionObject, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_SetCallHandler, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_setCallHandler, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_CALLABLE_INFO(0, callback, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_SetLength, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_setLength, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_function_template_InstanceTemplate, ZEND_RETURN_VALUE, 0, V8\\ObjectTemplate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_template_instanceTemplate, ZEND_RETURN_VALUE, 0, V8\\ObjectTemplate, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_function_template_Inherit, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template_inherit, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, parent, V8\\FunctionTemplate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_function_template_PrototypeTemplate, ZEND_RETURN_VALUE, 0, V8\\ObjectTemplate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_template_prototypeTemplate, ZEND_RETURN_VALUE, 0, V8\\ObjectTemplate, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_function_template_SetClassName, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template_setClassName, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, name, V8\\StringValue, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_function_template_SetAcceptAnyReceiver, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template_setAcceptAnyReceiver, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, value, _IS_BOOL, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_function_template_SetHiddenPrototype, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template_setHiddenPrototype, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, value, _IS_BOOL, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_function_template_ReadOnlyPrototype, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template_readOnlyPrototype, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_function_template_RemovePrototype, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template_removePrototype, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_function_template_HasInstance, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_function_template_hasInstance, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, object, V8\\ObjectValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_function_template_AdjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_function_template_adjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, change_in_bytes, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_function_template_GetExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_function_template_getExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_function_template_methods[] = { - PHP_ME(V8FunctionTemplate, __construct, arginfo_v8_function_template___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8FunctionTemplate, GetIsolate, arginfo_v8_function_template_GetIsolate, ZEND_ACC_PUBLIC) - - PHP_ME(V8FunctionTemplate, Set, arginfo_php_v8_function_template_Set, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, SetAccessorProperty, arginfo_php_v8_function_template_SetAccessorProperty, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, SetNativeDataProperty, arginfo_php_v8_function_template_SetNativeDataProperty, ZEND_ACC_PUBLIC) - - PHP_ME(V8FunctionTemplate, GetFunction, arginfo_php_v8_function_template_GetFunction, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, SetCallHandler, arginfo_php_v8_function_template_SetCallHandler, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, SetLength, arginfo_php_v8_function_template_SetLength, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, InstanceTemplate, arginfo_v8_function_template_InstanceTemplate, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, Inherit, arginfo_v8_function_template_Inherit, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, PrototypeTemplate, arginfo_v8_function_template_PrototypeTemplate, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, SetClassName, arginfo_v8_function_template_SetClassName, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, SetAcceptAnyReceiver, arginfo_v8_function_template_SetAcceptAnyReceiver, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, SetHiddenPrototype, arginfo_v8_function_template_SetHiddenPrototype, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, ReadOnlyPrototype, arginfo_v8_function_template_ReadOnlyPrototype, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, RemovePrototype, arginfo_v8_function_template_RemovePrototype, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, HasInstance, arginfo_v8_function_template_HasInstance, ZEND_ACC_PUBLIC) - - PHP_ME(V8FunctionTemplate, AdjustExternalAllocatedMemory, arginfo_v8_function_template_AdjustExternalAllocatedMemory, ZEND_ACC_PUBLIC) - PHP_ME(V8FunctionTemplate, GetExternalAllocatedMemory, arginfo_v8_function_template_GetExternalAllocatedMemory, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, __construct, arginfo_function_template___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(FunctionTemplate, getIsolate, arginfo_function_template_getIsolate, ZEND_ACC_PUBLIC) + + PHP_ME(FunctionTemplate, set, arginfo_php_v8_function_template_set, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, setAccessorProperty, arginfo_php_v8_function_template_setAccessorProperty, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, setNativeDataProperty, arginfo_php_v8_function_template_setNativeDataProperty, ZEND_ACC_PUBLIC) + + PHP_ME(FunctionTemplate, getFunction, arginfo_php_v8_function_template_getFunction, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, setCallHandler, arginfo_php_v8_function_template_setCallHandler, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, setLength, arginfo_php_v8_function_template_setLength, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, instanceTemplate, arginfo_function_template_instanceTemplate, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, inherit, arginfo_function_template_inherit, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, prototypeTemplate, arginfo_function_template_prototypeTemplate, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, setClassName, arginfo_function_template_setClassName, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, setAcceptAnyReceiver, arginfo_function_template_setAcceptAnyReceiver, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, setHiddenPrototype, arginfo_function_template_setHiddenPrototype, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, readOnlyPrototype, arginfo_function_template_readOnlyPrototype, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, removePrototype, arginfo_function_template_removePrototype, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, hasInstance, arginfo_function_template_hasInstance, ZEND_ACC_PUBLIC) + + PHP_ME(FunctionTemplate, adjustExternalAllocatedMemory, arginfo_function_template_adjustExternalAllocatedMemory, ZEND_ACC_PUBLIC) + PHP_ME(FunctionTemplate, getExternalAllocatedMemory, arginfo_function_template_getExternalAllocatedMemory, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_heap_statistics.cc b/src/php_v8_heap_statistics.cc index a78fd84..8147344 100644 --- a/src/php_v8_heap_statistics.cc +++ b/src/php_v8_heap_statistics.cc @@ -39,7 +39,7 @@ void php_v8_heap_statistics_create_from_heap_statistics(zval *return_value, v8:: zend_update_property_bool(this_ce, return_value, ZEND_STRL("does_zap_garbage"), static_cast(hs->does_zap_garbage())); } -static PHP_METHOD(V8HeapStatistics, __construct) { +static PHP_METHOD(HeapStatistics, __construct) { double total_heap_size = 0; double total_heap_size_executable = 0; double total_physical_size = 0; @@ -70,7 +70,7 @@ static PHP_METHOD(V8HeapStatistics, __construct) { zend_update_property_bool(this_ce, getThis(), ZEND_STRL("does_zap_garbage"), does_zap_garbage); } -static PHP_METHOD(V8HeapStatistics, total_heap_size) { +static PHP_METHOD(HeapStatistics, total_heap_size) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -80,7 +80,7 @@ static PHP_METHOD(V8HeapStatistics, total_heap_size) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("total_heap_size"), 0, &rv), 1, 0); } -static PHP_METHOD(V8HeapStatistics, total_heap_size_executable) { +static PHP_METHOD(HeapStatistics, total_heap_size_executable) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -90,7 +90,7 @@ static PHP_METHOD(V8HeapStatistics, total_heap_size_executable) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("total_heap_size_executable"), 0, &rv), 1, 0); } -static PHP_METHOD(V8HeapStatistics, total_physical_size) { +static PHP_METHOD(HeapStatistics, total_physical_size) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -100,7 +100,7 @@ static PHP_METHOD(V8HeapStatistics, total_physical_size) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("total_physical_size"), 0, &rv), 1, 0); } -static PHP_METHOD(V8HeapStatistics, total_available_size) { +static PHP_METHOD(HeapStatistics, total_available_size) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -110,7 +110,7 @@ static PHP_METHOD(V8HeapStatistics, total_available_size) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("total_available_size"), 0, &rv), 1, 0); } -static PHP_METHOD(V8HeapStatistics, used_heap_size) { +static PHP_METHOD(HeapStatistics, used_heap_size) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -120,7 +120,7 @@ static PHP_METHOD(V8HeapStatistics, used_heap_size) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("used_heap_size"), 0, &rv), 1, 0); } -static PHP_METHOD(V8HeapStatistics, heap_size_limit) { +static PHP_METHOD(HeapStatistics, heap_size_limit) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -130,7 +130,7 @@ static PHP_METHOD(V8HeapStatistics, heap_size_limit) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("heap_size_limit"), 0, &rv), 1, 0); } -static PHP_METHOD(V8HeapStatistics, malloced_memory) { +static PHP_METHOD(HeapStatistics, malloced_memory) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -140,7 +140,7 @@ static PHP_METHOD(V8HeapStatistics, malloced_memory) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("malloced_memory"), 0, &rv), 1, 0); } -static PHP_METHOD(V8HeapStatistics, peak_malloced_memory) { +static PHP_METHOD(HeapStatistics, peak_malloced_memory) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -150,7 +150,7 @@ static PHP_METHOD(V8HeapStatistics, peak_malloced_memory) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("peak_malloced_memory"), 0, &rv), 1, 0); } -static PHP_METHOD(V8HeapStatistics, does_zap_garbage) { +static PHP_METHOD(HeapStatistics, does_zap_garbage) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -161,7 +161,7 @@ static PHP_METHOD(V8HeapStatistics, does_zap_garbage) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_heap_statistics___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_heap_statistics___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_ARG_TYPE_INFO(0, total_heap_size, IS_DOUBLE, 0) ZEND_ARG_TYPE_INFO(0, total_heap_size_executable, IS_DOUBLE, 0) ZEND_ARG_TYPE_INFO(0, total_physical_size, IS_DOUBLE, 0) @@ -175,46 +175,46 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_heap_statistics___construct, ZEND_SEND_BY_VAL, ZEND_ARG_TYPE_INFO(0, does_zap_garbage, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_heap_statistics__total_heap_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__total_heap_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_heap_statistics__total_heap_size_executable, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__total_heap_size_executable, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_heap_statistics__total_physical_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__total_physical_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_heap_statistics__total_available_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__total_available_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_heap_statistics__used_heap_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__used_heap_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_heap_statistics__heap_size_limit, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__heap_size_limit, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_heap_statistics__malloced_memory, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__malloced_memory, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_heap_statistics__peak_malloced_memory, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__peak_malloced_memory, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_heap_statistics__does_zap_garbage, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__does_zap_garbage, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_heap_statistics_methods[] = { - PHP_ME(V8HeapStatistics, __construct, arginfo_v8_heap_statistics___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(V8HeapStatistics, total_heap_size, arginfo_v8_heap_statistics__total_heap_size, ZEND_ACC_PUBLIC) - PHP_ME(V8HeapStatistics, total_heap_size_executable, arginfo_v8_heap_statistics__total_heap_size_executable, ZEND_ACC_PUBLIC) - PHP_ME(V8HeapStatistics, total_physical_size, arginfo_v8_heap_statistics__total_physical_size, ZEND_ACC_PUBLIC) - PHP_ME(V8HeapStatistics, total_available_size, arginfo_v8_heap_statistics__total_available_size, ZEND_ACC_PUBLIC) - PHP_ME(V8HeapStatistics, used_heap_size, arginfo_v8_heap_statistics__used_heap_size, ZEND_ACC_PUBLIC) - PHP_ME(V8HeapStatistics, heap_size_limit, arginfo_v8_heap_statistics__heap_size_limit, ZEND_ACC_PUBLIC) - PHP_ME(V8HeapStatistics, malloced_memory, arginfo_v8_heap_statistics__malloced_memory, ZEND_ACC_PUBLIC) - PHP_ME(V8HeapStatistics, peak_malloced_memory, arginfo_v8_heap_statistics__peak_malloced_memory, ZEND_ACC_PUBLIC) - PHP_ME(V8HeapStatistics, does_zap_garbage, arginfo_v8_heap_statistics__does_zap_garbage, ZEND_ACC_PUBLIC) + PHP_ME(HeapStatistics, __construct, arginfo_heap_statistics___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + + PHP_ME(HeapStatistics, total_heap_size, arginfo_heap_statistics__total_heap_size, ZEND_ACC_PUBLIC) + PHP_ME(HeapStatistics, total_heap_size_executable, arginfo_heap_statistics__total_heap_size_executable, ZEND_ACC_PUBLIC) + PHP_ME(HeapStatistics, total_physical_size, arginfo_heap_statistics__total_physical_size, ZEND_ACC_PUBLIC) + PHP_ME(HeapStatistics, total_available_size, arginfo_heap_statistics__total_available_size, ZEND_ACC_PUBLIC) + PHP_ME(HeapStatistics, used_heap_size, arginfo_heap_statistics__used_heap_size, ZEND_ACC_PUBLIC) + PHP_ME(HeapStatistics, heap_size_limit, arginfo_heap_statistics__heap_size_limit, ZEND_ACC_PUBLIC) + PHP_ME(HeapStatistics, malloced_memory, arginfo_heap_statistics__malloced_memory, ZEND_ACC_PUBLIC) + PHP_ME(HeapStatistics, peak_malloced_memory, arginfo_heap_statistics__peak_malloced_memory, ZEND_ACC_PUBLIC) + PHP_ME(HeapStatistics, does_zap_garbage, arginfo_heap_statistics__does_zap_garbage, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_indexed_property_handler_configuration.cc b/src/php_v8_indexed_property_handler_configuration.cc index f6e0459..86116d5 100644 --- a/src/php_v8_indexed_property_handler_configuration.cc +++ b/src/php_v8_indexed_property_handler_configuration.cc @@ -65,7 +65,7 @@ static zend_object * php_v8_indexed_property_handler_configuration_ctor(zend_cla return &php_v8_handler->std; } -static PHP_METHOD (V8IndexedPropertyHandlerConfiguration, __construct) { +static PHP_METHOD(IndexedPropertyHandlerConfiguration, __construct) { zend_fcall_info fci_getter = empty_fcall_info; zend_fcall_info_cache fci_cache_getter = empty_fcall_info_cache; @@ -134,7 +134,7 @@ ZEND_END_ARG_INFO() static const zend_function_entry php_v8_indexed_property_handler_configuration_methods[] = { - PHP_ME(V8IndexedPropertyHandlerConfiguration, __construct, php_v8_indexed_property_handler_configuration___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(IndexedPropertyHandlerConfiguration, __construct, php_v8_indexed_property_handler_configuration___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) PHP_FE_END }; diff --git a/src/php_v8_int32.cc b/src/php_v8_int32.cc index 1137669..451543b 100644 --- a/src/php_v8_int32.cc +++ b/src/php_v8_int32.cc @@ -24,7 +24,7 @@ zend_class_entry *php_v8_int32_class_entry; #define this_ce php_v8_int32_class_entry -static PHP_METHOD(V8Int32, __construct) { +static PHP_METHOD(Int32, __construct) { zval *php_v8_isolate_zv; zend_long value = 0; @@ -45,7 +45,7 @@ static PHP_METHOD(V8Int32, __construct) { } -static PHP_METHOD(V8Int32, Value) { +static PHP_METHOD(Int32, value) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -59,18 +59,18 @@ static PHP_METHOD(V8Int32, Value) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_int32___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_int32___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_int32_Value, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_int32_value, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_int32_methods[] = { - PHP_ME(V8Int32, __construct, arginfo_v8_int32___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Int32, Value, arginfo_v8_int32_Value, ZEND_ACC_PUBLIC) + PHP_ME(Int32, __construct, arginfo_int32___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Int32, value, arginfo_int32_value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_integer.cc b/src/php_v8_integer.cc index ca00eeb..a2be0f2 100644 --- a/src/php_v8_integer.cc +++ b/src/php_v8_integer.cc @@ -24,7 +24,7 @@ zend_class_entry *php_v8_integer_class_entry; #define this_ce php_v8_integer_class_entry -static PHP_METHOD(V8Integer, __construct) { +static PHP_METHOD(Integer, __construct) { zval *php_v8_isolate_zv; zend_long value = 0; @@ -50,7 +50,7 @@ static PHP_METHOD(V8Integer, __construct) { } -static PHP_METHOD(V8Integer, Value) { +static PHP_METHOD(Integer, value) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -64,18 +64,18 @@ static PHP_METHOD(V8Integer, Value) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_integer___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_integer___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_integer_Value, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_integer_value, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_integer_methods[] = { - PHP_ME(V8Integer, __construct, arginfo_v8_integer___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Integer, Value, arginfo_v8_integer_Value, ZEND_ACC_PUBLIC) + PHP_ME(Integer, __construct, arginfo_integer___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Integer, value, arginfo_integer_value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_isolate.cc b/src/php_v8_isolate.cc index cf6dfb6..916a971 100644 --- a/src/php_v8_isolate.cc +++ b/src/php_v8_isolate.cc @@ -188,7 +188,7 @@ static void php_v8_fatal_error_handler(const char *location, const char *message } -static PHP_METHOD(V8Isolate, __construct) { +static PHP_METHOD(Isolate, __construct) { zval *snapshot_zv = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "|o!", &snapshot_zv) == FAILURE) { @@ -222,7 +222,7 @@ static PHP_METHOD(V8Isolate, __construct) { php_v8_isolate->key.Reset(isolate, local_private_key); } -static PHP_METHOD(V8Isolate, SetTimeLimit) { +static PHP_METHOD(Isolate, setTimeLimit) { double time_limit_in_seconds; if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &time_limit_in_seconds) == FAILURE) { @@ -239,7 +239,7 @@ static PHP_METHOD(V8Isolate, SetTimeLimit) { php_v8_isolate_limits_set_time_limit(php_v8_isolate, time_limit_in_seconds); } -static PHP_METHOD(V8Isolate, GetTimeLimit) { +static PHP_METHOD(Isolate, getTimeLimit) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -249,7 +249,7 @@ static PHP_METHOD(V8Isolate, GetTimeLimit) { RETVAL_DOUBLE(php_v8_isolate->limits.time_limit); } -static PHP_METHOD(V8Isolate, IsTimeLimitHit) { +static PHP_METHOD(Isolate, isTimeLimitHit) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -259,7 +259,7 @@ static PHP_METHOD(V8Isolate, IsTimeLimitHit) { RETVAL_BOOL(php_v8_isolate->limits.time_limit_hit); } -static PHP_METHOD(V8Isolate, SetMemoryLimit) { +static PHP_METHOD(Isolate, setMemoryLimit) { long memory_limit_in_bytes; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &memory_limit_in_bytes) == FAILURE) { @@ -276,7 +276,7 @@ static PHP_METHOD(V8Isolate, SetMemoryLimit) { php_v8_isolate_limits_set_memory_limit(php_v8_isolate, static_cast(memory_limit_in_bytes)); } -static PHP_METHOD(V8Isolate, GetMemoryLimit) { +static PHP_METHOD(Isolate, getMemoryLimit) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -286,7 +286,7 @@ static PHP_METHOD(V8Isolate, GetMemoryLimit) { RETURN_LONG(php_v8_isolate->limits.memory_limit); } -static PHP_METHOD(V8Isolate, IsMemoryLimitHit) { +static PHP_METHOD(Isolate, isMemoryLimitHit) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -296,7 +296,7 @@ static PHP_METHOD(V8Isolate, IsMemoryLimitHit) { RETVAL_BOOL(php_v8_isolate->limits.memory_limit_hit); } -static PHP_METHOD(V8Isolate, GetHeapStatistics) { +static PHP_METHOD(Isolate, getHeapStatistics) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -311,7 +311,7 @@ static PHP_METHOD(V8Isolate, GetHeapStatistics) { php_v8_heap_statistics_create_from_heap_statistics(return_value, &hs); } -static PHP_METHOD(V8Isolate, InContext) { +static PHP_METHOD(Isolate, inContext) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -323,7 +323,7 @@ static PHP_METHOD(V8Isolate, InContext) { RETURN_BOOL(php_v8_isolate->isolate->InContext()) } -static PHP_METHOD(V8Isolate, GetEnteredContext) { +static PHP_METHOD(Isolate, getEnteredContext) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -344,7 +344,7 @@ static PHP_METHOD(V8Isolate, GetEnteredContext) { Z_ADDREF_P(return_value); } -static PHP_METHOD(V8Isolate, ThrowException) { +static PHP_METHOD(Isolate, throwException) { zval *php_v8_context_zv; zval *php_v8_value_zv; zval *exception_zv = NULL; @@ -385,7 +385,7 @@ static PHP_METHOD(V8Isolate, ThrowException) { isolate->ThrowException(local_value); } -static PHP_METHOD(V8Isolate, IdleNotificationDeadline) { +static PHP_METHOD(Isolate, idleNotificationDeadline) { double deadline_in_seconds; if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &deadline_in_seconds) == FAILURE) { @@ -398,7 +398,7 @@ static PHP_METHOD(V8Isolate, IdleNotificationDeadline) { RETURN_BOOL(isolate->IdleNotificationDeadline(deadline_in_seconds)); } -static PHP_METHOD(V8Isolate, LowMemoryNotification) { +static PHP_METHOD(Isolate, lowMemoryNotification) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -409,7 +409,7 @@ static PHP_METHOD(V8Isolate, LowMemoryNotification) { isolate->LowMemoryNotification(); } -static PHP_METHOD(V8Isolate, TerminateExecution) { +static PHP_METHOD(Isolate, terminateExecution) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -426,7 +426,7 @@ static PHP_METHOD(V8Isolate, TerminateExecution) { isolate->TerminateExecution(); } -static PHP_METHOD(V8Isolate, IsExecutionTerminating) { +static PHP_METHOD(Isolate, isExecutionTerminating) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -437,7 +437,7 @@ static PHP_METHOD(V8Isolate, IsExecutionTerminating) { RETURN_BOOL(isolate->IsExecutionTerminating()); } -static PHP_METHOD(V8Isolate, CancelTerminateExecution) { +static PHP_METHOD(Isolate, cancelTerminateExecution) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -448,7 +448,7 @@ static PHP_METHOD(V8Isolate, CancelTerminateExecution) { isolate->CancelTerminateExecution(); } -static PHP_METHOD(V8Isolate, SetCaptureStackTraceForUncaughtExceptions) { +static PHP_METHOD(Isolate, setCaptureStackTraceForUncaughtExceptions) { zend_bool capture; zend_long frame_limit = 10; @@ -464,7 +464,7 @@ static PHP_METHOD(V8Isolate, SetCaptureStackTraceForUncaughtExceptions) { isolate->SetCaptureStackTraceForUncaughtExceptions(static_cast(capture), static_cast(frame_limit)); } -static PHP_METHOD(V8Isolate, IsDead) { +static PHP_METHOD(Isolate, isDead) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -475,7 +475,7 @@ static PHP_METHOD(V8Isolate, IsDead) { RETURN_BOOL(isolate->IsDead()); } -static PHP_METHOD(V8Isolate, IsInUse) { +static PHP_METHOD(Isolate, isInUse) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -487,104 +487,104 @@ static PHP_METHOD(V8Isolate, IsInUse) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_isolate___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_ARG_OBJ_INFO(0, snapshot, V8\\StartupData, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_isolate_SetTimeLimit, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_setTimeLimit, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, time_limit_in_seconds, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_isolate_GetTimeLimit, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_getTimeLimit, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_isolate_IsTimeLimitHit, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_isTimeLimitHit, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_isolate_SetMemoryLimit, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_setMemoryLimit, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, memory_limit_in_bytes, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_isolate_GetMemoryLimit, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_getMemoryLimit, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_isolate_IsMemoryLimitHit, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_isMemoryLimitHit, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_isolate_GetHeapStatistics, ZEND_RETURN_VALUE, 0, V8\\HeapStatistics, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_isolate_getHeapStatistics, ZEND_RETURN_VALUE, 0, V8\\HeapStatistics, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_isolate_InContext, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_inContext, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_isolate_GetEnteredContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_isolate_getEnteredContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_isolate_ThrowException, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_throwException, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, e, Throwable, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_isolate_IdleNotificationDeadline, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_idleNotificationDeadline, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) ZEND_ARG_INFO(0, deadline_in_seconds) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_isolate_LowMemoryNotification, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_lowMemoryNotification, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_isolate_TerminateExecution, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_terminateExecution, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_isolate_IsExecutionTerminating, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_isExecutionTerminating, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_isolate_CancelTerminateExecution, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_cancelTerminateExecution, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_isolate_SetCaptureStackTraceForUncaughtExceptions, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_setCaptureStackTraceForUncaughtExceptions, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, capture, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, frame_limit, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_isolate_IsDead, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_isDead, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_isolate_IsInUse, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_isInUse, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_isolate_methods[] = { - PHP_ME(V8Isolate, __construct, arginfo_v8_isolate___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Isolate, __construct, arginfo_isolate___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Isolate, SetTimeLimit, arginfo_v8_isolate_SetTimeLimit, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, GetTimeLimit, arginfo_v8_isolate_GetTimeLimit, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, IsTimeLimitHit, arginfo_v8_isolate_IsTimeLimitHit, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, setTimeLimit, arginfo_isolate_setTimeLimit, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, getTimeLimit, arginfo_isolate_getTimeLimit, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, isTimeLimitHit, arginfo_isolate_isTimeLimitHit, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, SetMemoryLimit, arginfo_v8_isolate_SetMemoryLimit, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, GetMemoryLimit, arginfo_v8_isolate_GetMemoryLimit, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, IsMemoryLimitHit, arginfo_v8_isolate_IsMemoryLimitHit, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, setMemoryLimit, arginfo_isolate_setMemoryLimit, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, getMemoryLimit, arginfo_isolate_getMemoryLimit, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, isMemoryLimitHit, arginfo_isolate_isMemoryLimitHit, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, GetHeapStatistics, arginfo_v8_isolate_GetHeapStatistics, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, getHeapStatistics, arginfo_isolate_getHeapStatistics, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, InContext, arginfo_v8_isolate_InContext, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, GetEnteredContext, arginfo_v8_isolate_GetEnteredContext, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, inContext, arginfo_isolate_inContext, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, getEnteredContext, arginfo_isolate_getEnteredContext, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, ThrowException, arginfo_v8_isolate_ThrowException, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, IdleNotificationDeadline, arginfo_v8_isolate_IdleNotificationDeadline, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, LowMemoryNotification, arginfo_v8_isolate_LowMemoryNotification, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, throwException, arginfo_isolate_throwException, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, idleNotificationDeadline, arginfo_isolate_idleNotificationDeadline, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, lowMemoryNotification, arginfo_isolate_lowMemoryNotification, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, TerminateExecution, arginfo_v8_isolate_TerminateExecution, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, IsExecutionTerminating, arginfo_v8_isolate_IsExecutionTerminating, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, CancelTerminateExecution, arginfo_v8_isolate_CancelTerminateExecution, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, terminateExecution, arginfo_isolate_terminateExecution, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, isExecutionTerminating, arginfo_isolate_isExecutionTerminating, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, cancelTerminateExecution, arginfo_isolate_cancelTerminateExecution, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, SetCaptureStackTraceForUncaughtExceptions, arginfo_v8_isolate_SetCaptureStackTraceForUncaughtExceptions, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, IsDead, arginfo_v8_isolate_IsDead, ZEND_ACC_PUBLIC) - PHP_ME(V8Isolate, IsInUse, arginfo_v8_isolate_IsInUse, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, setCaptureStackTraceForUncaughtExceptions, arginfo_isolate_setCaptureStackTraceForUncaughtExceptions, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, isDead, arginfo_isolate_isDead, ZEND_ACC_PUBLIC) + PHP_ME(Isolate, isInUse, arginfo_isolate_isInUse, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_map.cc b/src/php_v8_map.cc index bf82d43..3db6724 100644 --- a/src/php_v8_map.cc +++ b/src/php_v8_map.cc @@ -24,7 +24,7 @@ zend_class_entry *php_v8_map_class_entry; #define this_ce php_v8_map_class_entry -static PHP_METHOD(V8Map, __construct) { +static PHP_METHOD(Map, __construct) { zval rv; zval *php_v8_context_zv; @@ -43,7 +43,7 @@ static PHP_METHOD(V8Map, __construct) { php_v8_value->persistent->Reset(isolate, local_map); } -static PHP_METHOD(V8Map, Size) { +static PHP_METHOD(Map, size) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -55,7 +55,7 @@ static PHP_METHOD(V8Map, Size) { RETURN_DOUBLE(php_v8_value_get_local_as(php_v8_value)->Size()); } -static PHP_METHOD(V8Map, Clear) { +static PHP_METHOD(Map, clear) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -67,7 +67,7 @@ static PHP_METHOD(V8Map, Clear) { php_v8_value_get_local_as(php_v8_value)->Clear(); } -static PHP_METHOD(V8Map, Get) { +static PHP_METHOD(Map, get) { zval *php_v8_context_zv; zval *php_v8_key_zv; v8::MaybeLocal maybe_local; @@ -103,7 +103,7 @@ static PHP_METHOD(V8Map, Get) { } -static PHP_METHOD(V8Map, Set) { +static PHP_METHOD(Map, set) { zval *php_v8_context_zv; zval *php_v8_key_zv; zval *php_v8_value_zv; @@ -140,7 +140,7 @@ static PHP_METHOD(V8Map, Set) { } -static PHP_METHOD(V8Map, Has) { +static PHP_METHOD(Map, has) { zval *php_v8_context_zv; zval *php_v8_key_zv; @@ -172,7 +172,7 @@ static PHP_METHOD(V8Map, Has) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Map, Delete) { +static PHP_METHOD(Map, delete) { zval *php_v8_context_zv; zval *php_v8_key_zv; @@ -204,7 +204,7 @@ static PHP_METHOD(V8Map, Delete) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Map, AsArray) { +static PHP_METHOD(Map, asArray) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -225,53 +225,53 @@ static PHP_METHOD(V8Map, AsArray) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_map___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_map___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_map_Size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_map_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_map_Clear, ZEND_RETURN_VALUE, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_map_clear, ZEND_RETURN_VALUE, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_map_Get, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_map_get, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_map_Set, ZEND_RETURN_VALUE, 3, V8\\MapObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_map_set, ZEND_RETURN_VALUE, 3, V8\\MapObject, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_map_Has, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_map_has, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_map_Delete, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_map_delete, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_map_AsArray, ZEND_RETURN_VALUE, 0, V8\\ArrayObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_map_asArray, ZEND_RETURN_VALUE, 0, V8\\ArrayObject, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_map_methods[] = { - PHP_ME(V8Map, __construct, arginfo_v8_map___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Map, __construct, arginfo_map___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Map, Size, arginfo_v8_map_Size, ZEND_ACC_PUBLIC) - PHP_ME(V8Map, Clear, arginfo_v8_map_Clear, ZEND_ACC_PUBLIC) + PHP_ME(Map, size, arginfo_map_size, ZEND_ACC_PUBLIC) + PHP_ME(Map, clear, arginfo_map_clear, ZEND_ACC_PUBLIC) - PHP_ME(V8Map, Get, arginfo_v8_map_Get, ZEND_ACC_PUBLIC) - PHP_ME(V8Map, Set, arginfo_v8_map_Set, ZEND_ACC_PUBLIC) - PHP_ME(V8Map, Has, arginfo_v8_map_Has, ZEND_ACC_PUBLIC) - PHP_ME(V8Map, Delete, arginfo_v8_map_Delete, ZEND_ACC_PUBLIC) + PHP_ME(Map, get, arginfo_map_get, ZEND_ACC_PUBLIC) + PHP_ME(Map, set, arginfo_map_set, ZEND_ACC_PUBLIC) + PHP_ME(Map, has, arginfo_map_has, ZEND_ACC_PUBLIC) + PHP_ME(Map, delete, arginfo_map_delete, ZEND_ACC_PUBLIC) - PHP_ME(V8Map, AsArray, arginfo_v8_map_AsArray, ZEND_ACC_PUBLIC) + PHP_ME(Map, asArray, arginfo_map_asArray, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_message.cc b/src/php_v8_message.cc index 4f41b83..db5f579 100644 --- a/src/php_v8_message.cc +++ b/src/php_v8_message.cc @@ -105,7 +105,7 @@ void php_v8_message_create_from_message(zval *return_value, php_v8_isolate_t *ph } -static PHP_METHOD(V8Message, __construct) { +static PHP_METHOD(Message, __construct) { zend_string *message = NULL; zend_string *source_line = NULL; @@ -145,7 +145,7 @@ static PHP_METHOD(V8Message, __construct) { zend_update_property_bool(this_ce, getThis(), ZEND_STRL("is_opaque"), is_opaque); } -static PHP_METHOD(V8Message, Get) +static PHP_METHOD(Message, get) { zval rv; @@ -156,7 +156,7 @@ static PHP_METHOD(V8Message, Get) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("message"), 0, &rv), 1, 0); } -static PHP_METHOD(V8Message, GetSourceLine) +static PHP_METHOD(Message, getSourceLine) { zval rv; @@ -167,7 +167,7 @@ static PHP_METHOD(V8Message, GetSourceLine) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("source_line"), 0, &rv), 1, 0); } -static PHP_METHOD(V8Message, GetScriptOrigin) +static PHP_METHOD(Message, getScriptOrigin) { zval rv; @@ -178,7 +178,7 @@ static PHP_METHOD(V8Message, GetScriptOrigin) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("script_origin"), 0, &rv), 1, 0); } -static PHP_METHOD(V8Message, GetScriptResourceName) +static PHP_METHOD(Message, getScriptResourceName) { zval rv; @@ -189,7 +189,7 @@ static PHP_METHOD(V8Message, GetScriptResourceName) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("resource_name"), 0, &rv), 1, 0); } -static PHP_METHOD(V8Message, GetStackTrace) +static PHP_METHOD(Message, getStackTrace) { zval rv; @@ -200,7 +200,7 @@ static PHP_METHOD(V8Message, GetStackTrace) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("stack_trace"), 0, &rv), 1, 0); } -static PHP_METHOD(V8Message, GetLineNumber) +static PHP_METHOD(Message, getLineNumber) { zval rv; @@ -211,7 +211,7 @@ static PHP_METHOD(V8Message, GetLineNumber) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("line_number"), 0, &rv), 1, 0); } -static PHP_METHOD(V8Message, GetStartPosition) +static PHP_METHOD(Message, getStartPosition) { zval rv; @@ -222,7 +222,7 @@ static PHP_METHOD(V8Message, GetStartPosition) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("start_position"), 0, &rv), 1, 0); } -static PHP_METHOD(V8Message, GetEndPosition) +static PHP_METHOD(Message, getEndPosition) { zval rv; @@ -233,7 +233,7 @@ static PHP_METHOD(V8Message, GetEndPosition) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("end_position"), 0, &rv), 1, 0); } -static PHP_METHOD(V8Message, GetStartColumn) +static PHP_METHOD(Message, getStartColumn) { zval rv; @@ -244,7 +244,7 @@ static PHP_METHOD(V8Message, GetStartColumn) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("start_column"), 0, &rv), 1, 0); } -static PHP_METHOD(V8Message, GetEndColumn) +static PHP_METHOD(Message, getEndColumn) { zval rv; @@ -255,7 +255,7 @@ static PHP_METHOD(V8Message, GetEndColumn) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("end_column"), 0, &rv), 1, 0); } -static PHP_METHOD(V8Message, IsSharedCrossOrigin) +static PHP_METHOD(Message, isSharedCrossOrigin) { zval rv; @@ -266,7 +266,7 @@ static PHP_METHOD(V8Message, IsSharedCrossOrigin) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("is_shared_cross_origin"), 0, &rv), 1, 0); } -static PHP_METHOD(V8Message, IsOpaque) +static PHP_METHOD(Message, isOpaque) { zval rv; @@ -277,7 +277,7 @@ static PHP_METHOD(V8Message, IsOpaque) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("is_opaque"), 0, &rv), 1, 0); } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_message___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 5) +ZEND_BEGIN_ARG_INFO_EX(arginfo_message___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 5) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, source_line, IS_STRING, 0) ZEND_ARG_OBJ_INFO(0, script_origin, V8\\ScriptOrigin, 0) @@ -292,62 +292,62 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_message___construct, ZEND_SEND_BY_VAL, ZEND_RE ZEND_ARG_TYPE_INFO(0, is_opaque, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_message_Get, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_get, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_message_GetSourceLine, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getSourceLine, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_message_GetScriptOrigin, ZEND_RETURN_VALUE, 0, V8\\ScriptOrigin, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_message_getScriptOrigin, ZEND_RETURN_VALUE, 0, V8\\ScriptOrigin, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_message_GetScriptResourceName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getScriptResourceName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_message_GetStackTrace, ZEND_RETURN_VALUE, 0, V8\\StackTrace, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_message_getStackTrace, ZEND_RETURN_VALUE, 0, V8\\StackTrace, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_message_GetLineNumber, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getLineNumber, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_message_GetStartPosition, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getStartPosition, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_message_GetEndPosition, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getEndPosition, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_message_GetStartColumn, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getStartColumn, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_message_GetEndColumn, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getEndColumn, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_message_IsSharedCrossOrigin, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_isSharedCrossOrigin, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_message_IsOpaque, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_isOpaque, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_message_methods[] = { - PHP_ME(V8Message, __construct, arginfo_v8_message___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Message, __construct, arginfo_message___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Message, Get, arginfo_v8_message_Get, ZEND_ACC_PUBLIC) - PHP_ME(V8Message, GetSourceLine, arginfo_v8_message_GetSourceLine, ZEND_ACC_PUBLIC) - PHP_ME(V8Message, GetScriptOrigin, arginfo_v8_message_GetScriptOrigin, ZEND_ACC_PUBLIC) - PHP_ME(V8Message, GetScriptResourceName, arginfo_v8_message_GetScriptResourceName, ZEND_ACC_PUBLIC) + PHP_ME(Message, get, arginfo_message_get, ZEND_ACC_PUBLIC) + PHP_ME(Message, getSourceLine, arginfo_message_getSourceLine, ZEND_ACC_PUBLIC) + PHP_ME(Message, getScriptOrigin, arginfo_message_getScriptOrigin, ZEND_ACC_PUBLIC) + PHP_ME(Message, getScriptResourceName, arginfo_message_getScriptResourceName, ZEND_ACC_PUBLIC) - PHP_ME(V8Message, GetStackTrace, arginfo_v8_message_GetStackTrace, ZEND_ACC_PUBLIC) + PHP_ME(Message, getStackTrace, arginfo_message_getStackTrace, ZEND_ACC_PUBLIC) - PHP_ME(V8Message, GetLineNumber, arginfo_v8_message_GetLineNumber, ZEND_ACC_PUBLIC) - PHP_ME(V8Message, GetStartPosition, arginfo_v8_message_GetStartPosition, ZEND_ACC_PUBLIC) - PHP_ME(V8Message, GetEndPosition, arginfo_v8_message_GetEndPosition, ZEND_ACC_PUBLIC) + PHP_ME(Message, getLineNumber, arginfo_message_getLineNumber, ZEND_ACC_PUBLIC) + PHP_ME(Message, getStartPosition, arginfo_message_getStartPosition, ZEND_ACC_PUBLIC) + PHP_ME(Message, getEndPosition, arginfo_message_getEndPosition, ZEND_ACC_PUBLIC) - PHP_ME(V8Message, GetStartColumn, arginfo_v8_message_GetStartColumn, ZEND_ACC_PUBLIC) - PHP_ME(V8Message, GetEndColumn, arginfo_v8_message_GetEndColumn, ZEND_ACC_PUBLIC) + PHP_ME(Message, getStartColumn, arginfo_message_getStartColumn, ZEND_ACC_PUBLIC) + PHP_ME(Message, getEndColumn, arginfo_message_getEndColumn, ZEND_ACC_PUBLIC) - PHP_ME(V8Message, IsSharedCrossOrigin, arginfo_v8_message_IsSharedCrossOrigin, ZEND_ACC_PUBLIC) - PHP_ME(V8Message, IsOpaque, arginfo_v8_message_IsOpaque, ZEND_ACC_PUBLIC) + PHP_ME(Message, isSharedCrossOrigin, arginfo_message_isSharedCrossOrigin, ZEND_ACC_PUBLIC) + PHP_ME(Message, isOpaque, arginfo_message_isOpaque, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_name.cc b/src/php_v8_name.cc index d74626e..dcf6f7a 100644 --- a/src/php_v8_name.cc +++ b/src/php_v8_name.cc @@ -23,7 +23,7 @@ zend_class_entry* php_v8_name_class_entry; #define this_ce php_v8_name_class_entry -static PHP_METHOD(V8Name, GetIdentityHash) +static PHP_METHOD(Name, getIdentityHash) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -42,12 +42,12 @@ static PHP_METHOD(V8Name, GetIdentityHash) } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_name_GetIdentityHash, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_name_getIdentityHash, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_name_methods[] = { - PHP_ME(V8Name, GetIdentityHash, arginfo_v8_name_GetIdentityHash, ZEND_ACC_PUBLIC) + PHP_ME(Name, getIdentityHash, arginfo_name_getIdentityHash, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_named_property_handler_configuration.cc b/src/php_v8_named_property_handler_configuration.cc index 56b2e22..eda74f4 100644 --- a/src/php_v8_named_property_handler_configuration.cc +++ b/src/php_v8_named_property_handler_configuration.cc @@ -65,7 +65,7 @@ static zend_object * php_v8_named_property_handler_configuration_ctor(zend_class } -static PHP_METHOD (V8NamedPropertyHandlerConfiguration, __construct) { +static PHP_METHOD(NamedPropertyHandlerConfiguration, __construct) { zend_fcall_info fci_getter = empty_fcall_info; zend_fcall_info_cache fci_cache_getter = empty_fcall_info_cache; @@ -134,7 +134,7 @@ ZEND_END_ARG_INFO() static const zend_function_entry php_v8_named_property_handler_configuration_methods[] = { - PHP_ME(V8NamedPropertyHandlerConfiguration, __construct, php_v8_named_property_handler_configuration___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(NamedPropertyHandlerConfiguration, __construct, php_v8_named_property_handler_configuration___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) PHP_FE_END }; diff --git a/src/php_v8_null.cc b/src/php_v8_null.cc index 8c9baf6..8c79302 100644 --- a/src/php_v8_null.cc +++ b/src/php_v8_null.cc @@ -22,7 +22,7 @@ zend_class_entry *php_v8_null_class_entry; #define this_ce php_v8_null_class_entry -static PHP_METHOD(V8NullValue, __construct) { +static PHP_METHOD(NullValue, __construct) { zval *php_v8_isolate_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_isolate_zv) == FAILURE) { @@ -34,7 +34,7 @@ static PHP_METHOD(V8NullValue, __construct) { php_v8_value->persistent->Reset(isolate, v8::Null(isolate)); } -static PHP_METHOD(V8NullValue, Value) { +static PHP_METHOD(NullValue, value) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -43,16 +43,16 @@ static PHP_METHOD(V8NullValue, Value) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_null___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_null___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_null_Value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_null_value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_null_methods[] = { - PHP_ME(V8NullValue, __construct, arginfo_v8_null___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8NullValue, Value, arginfo_v8_null_Value, ZEND_ACC_PUBLIC) + PHP_ME(NullValue, __construct, arginfo_null___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(NullValue, value, arginfo_null_value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_number.cc b/src/php_v8_number.cc index 237f386..5023ffd 100644 --- a/src/php_v8_number.cc +++ b/src/php_v8_number.cc @@ -23,7 +23,7 @@ zend_class_entry *php_v8_number_class_entry; #define this_ce php_v8_number_class_entry -static PHP_METHOD(V8Number, __construct) { +static PHP_METHOD(Number, __construct) { zval *php_v8_isolate_zv; double value = 0; @@ -42,7 +42,7 @@ static PHP_METHOD(V8Number, __construct) { } -static PHP_METHOD(V8Number, Value) { +static PHP_METHOD(Number, value) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -56,19 +56,19 @@ static PHP_METHOD(V8Number, Value) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_number___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_number___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_TYPE_INFO(0, value, IS_DOUBLE, 0) ZEND_END_ARG_INFO() // no strict typing while we'll inherit this class -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_number_Value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_number_value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_number_methods[] = { - PHP_ME(V8Number, __construct, arginfo_v8_number___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Number, Value, arginfo_v8_number_Value, ZEND_ACC_PUBLIC) + PHP_ME(Number, __construct, arginfo_number___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Number, value, arginfo_number_value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_number_object.cc b/src/php_v8_number_object.cc index 9602117..0022a1e 100644 --- a/src/php_v8_number_object.cc +++ b/src/php_v8_number_object.cc @@ -24,7 +24,7 @@ zend_class_entry *php_v8_number_object_class_entry; #define this_ce php_v8_number_object_class_entry -static PHP_METHOD(V8NumberObject, __construct) { +static PHP_METHOD(NumberObject, __construct) { zval rv; zval *php_v8_context_zv; @@ -45,7 +45,7 @@ static PHP_METHOD(V8NumberObject, __construct) { php_v8_value->persistent->Reset(isolate, local_number_obj); } -static PHP_METHOD(V8NumberObject, ValueOf) { +static PHP_METHOD(NumberObject, valueOf) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -58,19 +58,19 @@ static PHP_METHOD(V8NumberObject, ValueOf) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_number_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_number_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_number_object_ValueOf, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_number_object_valueOf, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_number_object_methods[] = { - PHP_ME(V8NumberObject, __construct, arginfo_v8_number_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(NumberObject, __construct, arginfo_number_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8NumberObject, ValueOf, arginfo_v8_number_object_ValueOf, ZEND_ACC_PUBLIC) + PHP_ME(NumberObject, valueOf, arginfo_number_object_valueOf, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_object.cc b/src/php_v8_object.cc index 09ec3b4..25f5f1b 100644 --- a/src/php_v8_object.cc +++ b/src/php_v8_object.cc @@ -97,7 +97,7 @@ php_v8_value_t * php_v8_object_get_self_ptr(php_v8_isolate_t *php_v8_isolate, v8 } -static PHP_METHOD(V8Object, __construct) { +static PHP_METHOD(Object, __construct) { zval rv; zval *php_v8_context_zv; @@ -116,7 +116,7 @@ static PHP_METHOD(V8Object, __construct) { php_v8_value->persistent->Reset(isolate, local_object); } -static PHP_METHOD(V8Object, GetContext) { +static PHP_METHOD(Object, getContext) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -128,7 +128,7 @@ static PHP_METHOD(V8Object, GetContext) { RETURN_ZVAL(PHP_V8_OBJECT_READ_CONTEXT(getThis()), 1, 0); } -static PHP_METHOD(V8Object, Set) { +static PHP_METHOD(Object, set) { zval *php_v8_context_zv; zval *php_v8_key_or_index_zv; zval *php_v8_value_zv; @@ -164,7 +164,7 @@ static PHP_METHOD(V8Object, Set) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Object, CreateDataProperty) { +static PHP_METHOD(Object, createDataProperty) { zval *php_v8_context_zv; zval *php_v8_key_or_index_zv; zval *php_v8_value_zv; @@ -200,7 +200,7 @@ static PHP_METHOD(V8Object, CreateDataProperty) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Object, DefineOwnProperty) { +static PHP_METHOD(Object, defineOwnProperty) { zval *php_v8_context_zv; zval *php_v8_value_zv; zval *php_v8_key_zv; @@ -245,7 +245,7 @@ static PHP_METHOD(V8Object, DefineOwnProperty) { RETURN_BOOL(maybe.FromJust()) } -static PHP_METHOD(V8Object, Get) { +static PHP_METHOD(Object, get) { zval *php_v8_context_zv; zval *php_v8_key_or_index_zv; v8::MaybeLocal maybe_local; @@ -280,7 +280,7 @@ static PHP_METHOD(V8Object, Get) { php_v8_get_or_create_value(return_value, local_value, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Object, GetPropertyAttributes) { +static PHP_METHOD(Object, getPropertyAttributes) { zval *php_v8_context_zv; zval *php_v8_string_zv; @@ -312,7 +312,7 @@ static PHP_METHOD(V8Object, GetPropertyAttributes) { RETURN_LONG(static_cast(maybe.FromJust())); } -static PHP_METHOD(V8Object, GetOwnPropertyDescriptor) { +static PHP_METHOD(Object, getOwnPropertyDescriptor) { zval *php_v8_context_zv; zval *php_v8_string_zv; @@ -346,7 +346,7 @@ static PHP_METHOD(V8Object, GetOwnPropertyDescriptor) { php_v8_get_or_create_value(return_value, local_value, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Object, Has) { +static PHP_METHOD(Object, has) { zval *php_v8_context_zv; zval *php_v8_key_or_index_zv; @@ -378,7 +378,7 @@ static PHP_METHOD(V8Object, Has) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Object, Delete) { +static PHP_METHOD(Object, delete) { zval *php_v8_context_zv; zval *php_v8_key_or_index_zv; @@ -410,7 +410,7 @@ static PHP_METHOD(V8Object, Delete) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Object, SetAccessor) { +static PHP_METHOD(Object, setAccessor) { zval *context_zv; zval *php_v8_name_zv; @@ -483,7 +483,7 @@ static PHP_METHOD(V8Object, SetAccessor) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Object, SetAccessorProperty) { +static PHP_METHOD(Object, setAccessorProperty) { zval *php_v8_name_zv; zval *getter_zv; zval *setter_zv; @@ -539,7 +539,7 @@ static PHP_METHOD(V8Object, SetAccessorProperty) { // AccessorNameSetterCallback setter = nullptr, // Local data = Local(), PropertyAttribute attributes = None); -static PHP_METHOD(V8Object, SetNativeDataProperty) { +static PHP_METHOD(Object, setNativeDataProperty) { zval *context_zv; zval *php_v8_name_zv; @@ -609,7 +609,7 @@ static PHP_METHOD(V8Object, SetNativeDataProperty) { /* NOTE: we skip functionality for private properties for now */ -static PHP_METHOD(V8Object, GetPropertyNames) { +static PHP_METHOD(Object, getPropertyNames) { zval *context_zv; zend_long mode = static_cast(v8::KeyCollectionMode::kOwnOnly); zend_long property_filter = static_cast(v8::PropertyFilter::ALL_PROPERTIES); @@ -649,7 +649,7 @@ static PHP_METHOD(V8Object, GetPropertyNames) { php_v8_get_or_create_value(return_value, local_array, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Object, GetOwnPropertyNames) { +static PHP_METHOD(Object, getOwnPropertyNames) { zval *context_zv; zend_long filter = static_cast(v8::PropertyFilter::ALL_PROPERTIES); @@ -681,7 +681,7 @@ static PHP_METHOD(V8Object, GetOwnPropertyNames) { php_v8_get_or_create_value(return_value, local_array, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Object, GetPrototype) { +static PHP_METHOD(Object, getPrototype) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -703,7 +703,7 @@ static PHP_METHOD(V8Object, GetPrototype) { php_v8_get_or_create_value(return_value, local_prototype, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Object, SetPrototype) { +static PHP_METHOD(Object, setPrototype) { zval *context_zv; zval *value_zv; @@ -736,7 +736,7 @@ static PHP_METHOD(V8Object, SetPrototype) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Object, FindInstanceInPrototypeChain) { +static PHP_METHOD(Object, findInstanceInPrototypeChain) { zval *function_template_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &function_template_zv) == FAILURE) { @@ -765,7 +765,7 @@ static PHP_METHOD(V8Object, FindInstanceInPrototypeChain) { php_v8_get_or_create_value(return_value, local_found, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Object, ObjectProtoToString) { +static PHP_METHOD(Object, objectProtoToString) { zval *context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &context_zv) == FAILURE) { @@ -795,7 +795,7 @@ static PHP_METHOD(V8Object, ObjectProtoToString) { php_v8_get_or_create_value(return_value, local_string, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Object, GetConstructorName) { +static PHP_METHOD(Object, getConstructorName) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -809,7 +809,7 @@ static PHP_METHOD(V8Object, GetConstructorName) { php_v8_get_or_create_value(return_value, local_object->GetConstructorName(), php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Object, SetIntegrityLevel) { +static PHP_METHOD(Object, setIntegrityLevel) { zval *php_v8_context_zv; zend_long level; @@ -840,7 +840,7 @@ static PHP_METHOD(V8Object, SetIntegrityLevel) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Object, HasOwnProperty) { +static PHP_METHOD(Object, hasOwnProperty) { zval *php_v8_context_zv; zval *php_v8_name_zv; @@ -872,7 +872,7 @@ static PHP_METHOD(V8Object, HasOwnProperty) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Object, HasRealNamedProperty) { +static PHP_METHOD(Object, hasRealNamedProperty) { zval *php_v8_context_zv; zval *php_v8_name_zv; @@ -904,7 +904,7 @@ static PHP_METHOD(V8Object, HasRealNamedProperty) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Object, HasRealIndexedProperty) { +static PHP_METHOD(Object, hasRealIndexedProperty) { zval *php_v8_context_zv; zend_long index; @@ -935,7 +935,7 @@ static PHP_METHOD(V8Object, HasRealIndexedProperty) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Object, HasRealNamedCallbackProperty) { +static PHP_METHOD(Object, hasRealNamedCallbackProperty) { zval *php_v8_context_zv; zval *php_v8_name_zv; @@ -967,7 +967,7 @@ static PHP_METHOD(V8Object, HasRealNamedCallbackProperty) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Object, GetRealNamedPropertyInPrototypeChain) { +static PHP_METHOD(Object, getRealNamedPropertyInPrototypeChain) { zval *php_v8_context_zv; zval *php_v8_name_zv; @@ -1001,7 +1001,7 @@ static PHP_METHOD(V8Object, GetRealNamedPropertyInPrototypeChain) { php_v8_get_or_create_value(return_value, local_value, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Object, GetRealNamedPropertyAttributesInPrototypeChain) { +static PHP_METHOD(Object, getRealNamedPropertyAttributesInPrototypeChain) { zval *php_v8_context_zv; zval *php_v8_name_zv; @@ -1033,7 +1033,7 @@ static PHP_METHOD(V8Object, GetRealNamedPropertyAttributesInPrototypeChain) { RETURN_LONG((zend_long) maybe_res.FromJust()); } -static PHP_METHOD(V8Object, GetRealNamedProperty) { +static PHP_METHOD(Object, getRealNamedProperty) { zval *php_v8_context_zv; zval *php_v8_name_zv; @@ -1063,7 +1063,7 @@ static PHP_METHOD(V8Object, GetRealNamedProperty) { php_v8_get_or_create_value(return_value, local_value, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Object, GetRealNamedPropertyAttributes) { +static PHP_METHOD(Object, getRealNamedPropertyAttributes) { zval *php_v8_context_zv; zval *php_v8_name_zv; @@ -1095,7 +1095,7 @@ static PHP_METHOD(V8Object, GetRealNamedPropertyAttributes) { RETURN_LONG((zend_long) maybe_res.FromJust()); } -static PHP_METHOD(V8Object, HasNamedLookupInterceptor) { +static PHP_METHOD(Object, hasNamedLookupInterceptor) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -1109,7 +1109,7 @@ static PHP_METHOD(V8Object, HasNamedLookupInterceptor) { RETURN_BOOL(local_object->HasNamedLookupInterceptor()); } -static PHP_METHOD(V8Object, HasIndexedLookupInterceptor) { +static PHP_METHOD(Object, hasIndexedLookupInterceptor) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -1123,7 +1123,7 @@ static PHP_METHOD(V8Object, HasIndexedLookupInterceptor) { RETURN_BOOL(local_object->HasIndexedLookupInterceptor()); } -static PHP_METHOD(V8Object, GetIdentityHash) +static PHP_METHOD(Object, getIdentityHash) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -1138,7 +1138,7 @@ static PHP_METHOD(V8Object, GetIdentityHash) RETVAL_LONG(local_object->GetIdentityHash()); } -static PHP_METHOD(V8Object, Clone) { +static PHP_METHOD(Object, clone) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -1160,7 +1160,7 @@ static PHP_METHOD(V8Object, Clone) { php_v8_get_or_create_value(return_value, local_cloned_object, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Object, IsCallable) { +static PHP_METHOD(Object, isCallable) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -1175,7 +1175,7 @@ static PHP_METHOD(V8Object, IsCallable) { } -static PHP_METHOD(V8Object, IsConstructor) { +static PHP_METHOD(Object, isConstructor) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -1189,7 +1189,7 @@ static PHP_METHOD(V8Object, IsConstructor) { RETURN_BOOL(local_object->IsConstructor()); } -static PHP_METHOD(V8Object, CallAsFunction) { +static PHP_METHOD(Object, callAsFunction) { zval *php_v8_context_zv; zval *php_v8_recv_zv; zval* arguments_zv = NULL; @@ -1236,7 +1236,7 @@ static PHP_METHOD(V8Object, CallAsFunction) { php_v8_get_or_create_value(return_value, local_res, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Object, CallAsConstructor) { +static PHP_METHOD(Object, callAsConstructor) { zval *php_v8_context_zv; zval* arguments_zv = NULL; @@ -1279,69 +1279,69 @@ static PHP_METHOD(V8Object, CallAsConstructor) { } /* Non-standard, implementations of AdjustableExternalMemoryInterface::AdjustExternalAllocatedMemory */ -static PHP_METHOD(V8Object, AdjustExternalAllocatedMemory) { +static PHP_METHOD(Object, adjustExternalAllocatedMemory) { php_v8_ext_mem_interface_value_AdjustExternalAllocatedMemory(INTERNAL_FUNCTION_PARAM_PASSTHRU); } /* Non-standard, implementations of AdjustableExternalMemoryInterface::GetExternalAllocatedMemory */ -static PHP_METHOD(V8Object, GetExternalAllocatedMemory) { +static PHP_METHOD(Object, getExternalAllocatedMemory) { php_v8_ext_mem_interface_value_GetExternalAllocatedMemory(INTERNAL_FUNCTION_PARAM_PASSTHRU); } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_object_GetContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_object_Set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 3) +ZEND_BEGIN_ARG_INFO_EX(arginfo_object_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 3) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_CreateDataProperty, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_createDataProperty, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_DefineOwnProperty, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_defineOwnProperty, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Value, 0) ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_object_Get, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_get, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_GetPropertyAttributes, ZEND_RETURN_VALUE, 2, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_getPropertyAttributes, ZEND_RETURN_VALUE, 2, IS_LONG, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_object_GetOwnPropertyDescriptor, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_getOwnPropertyDescriptor, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_Has, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_has, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_Delete, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_delete, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() // bool -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_SetAccessor, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_setAccessor, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_CALLABLE_INFO(0, getter, 0) @@ -1351,7 +1351,7 @@ PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_SetAccessor, ZE ZEND_END_ARG_INFO() //void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_SetAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_setAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, getter, V8\\FunctionObject, 0) ZEND_ARG_OBJ_INFO(0, setter, V8\\FunctionObject, 0) @@ -1359,7 +1359,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_SetAccessorProperty, ZEND_SEND_BY_V ZEND_ARG_TYPE_INFO(0, settings, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_object_SetNativeDataProperty, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_object_setNativeDataProperty, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_CALLABLE_INFO(0, getter, 0) @@ -1367,167 +1367,167 @@ PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_object_SetNativeDa ZEND_ARG_TYPE_INFO(0, attributes, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_GetPropertyNames, ZEND_RETURN_VALUE, 1, V8\\ArrayObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_getPropertyNames, ZEND_RETURN_VALUE, 1, V8\\ArrayObject, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, property_filter, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, index_filter, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_GetOwnPropertyNames, ZEND_RETURN_VALUE, 1, V8\\ArrayObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_getOwnPropertyNames, ZEND_RETURN_VALUE, 1, V8\\ArrayObject, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_TYPE_INFO(0, filter, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_GetPrototype, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_getPrototype, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_object_SetPrototype, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_object_setPrototype, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, prototype, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_FindInstanceInPrototypeChain, ZEND_RETURN_VALUE, 1, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_findInstanceInPrototypeChain, ZEND_RETURN_VALUE, 1, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, tmpl, V8\\FunctionTemplate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_ObjectProtoToString, ZEND_RETURN_VALUE, 1, V8\\StringValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_objectProtoToString, ZEND_RETURN_VALUE, 1, V8\\StringValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_object_GetConstructorName, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_getConstructorName, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_SetIntegrityLevel, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_setIntegrityLevel, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_HasOwnProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_hasOwnProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_HasRealNamedProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_hasRealNamedProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_HasRealIndexedProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_hasRealIndexedProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_HasRealNamedCallbackProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_hasRealNamedCallbackProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_object_GetRealNamedPropertyInPrototypeChain, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_getRealNamedPropertyInPrototypeChain, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_GetRealNamedPropertyAttributesInPrototypeChain, ZEND_RETURN_VALUE, 2, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_getRealNamedPropertyAttributesInPrototypeChain, ZEND_RETURN_VALUE, 2, IS_LONG, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_object_GetRealNamedProperty, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_getRealNamedProperty, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_GetRealNamedPropertyAttributes, ZEND_RETURN_VALUE, 2, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_getRealNamedPropertyAttributes, ZEND_RETURN_VALUE, 2, IS_LONG, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_HasNamedLookupInterceptor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_hasNamedLookupInterceptor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_HasIndexedLookupInterceptor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_hasIndexedLookupInterceptor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_GetIdentityHash, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_getIdentityHash, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_object_Clone, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_clone, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_IsCallable, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_isCallable, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_IsConstructor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_isConstructor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_object_CallAsFunction, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_callAsFunction, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, recv, V8\\Value, 0) ZEND_ARG_ARRAY_INFO(0, arguments, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_object_CallAsConstructor, ZEND_RETURN_VALUE, 1, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_callAsConstructor, ZEND_RETURN_VALUE, 1, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_ARRAY_INFO(0, arguments, 0) ZEND_END_ARG_INFO() // static methods -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_AdjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_adjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, change_in_bytes, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_GetExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_getExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_object_methods[] = { - PHP_ME(V8Object, __construct, arginfo_v8_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Object, GetContext, arginfo_v8_object_GetContext, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, Set, arginfo_v8_object_Set, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, CreateDataProperty, arginfo_v8_object_CreateDataProperty, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, DefineOwnProperty, arginfo_v8_object_DefineOwnProperty, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, Get, arginfo_v8_object_Get, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, GetPropertyAttributes, arginfo_v8_object_GetPropertyAttributes, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, GetOwnPropertyDescriptor, arginfo_v8_object_GetOwnPropertyDescriptor, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, Has, arginfo_v8_object_Has, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, Delete, arginfo_v8_object_Delete, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, SetAccessor, arginfo_v8_object_SetAccessor, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, SetAccessorProperty, arginfo_php_v8_object_SetAccessorProperty, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, SetNativeDataProperty, arginfo_php_v8_object_SetNativeDataProperty, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, GetPropertyNames, arginfo_php_v8_object_GetPropertyNames, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, GetOwnPropertyNames, arginfo_php_v8_object_GetOwnPropertyNames, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, GetPrototype, arginfo_php_v8_object_GetPrototype, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, SetPrototype, arginfo_php_v8_object_SetPrototype, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, FindInstanceInPrototypeChain, arginfo_php_v8_object_FindInstanceInPrototypeChain, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, ObjectProtoToString, arginfo_php_v8_object_ObjectProtoToString, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, GetConstructorName, arginfo_v8_object_GetConstructorName, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, SetIntegrityLevel, arginfo_v8_object_SetIntegrityLevel, ZEND_ACC_PUBLIC) - - PHP_ME(V8Object, HasOwnProperty, arginfo_v8_object_HasOwnProperty, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, HasRealNamedProperty, arginfo_v8_object_HasRealNamedProperty, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, HasRealIndexedProperty, arginfo_v8_object_HasRealIndexedProperty, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, HasRealNamedCallbackProperty, arginfo_v8_object_HasRealNamedCallbackProperty, ZEND_ACC_PUBLIC) - - PHP_ME(V8Object, GetRealNamedPropertyInPrototypeChain, arginfo_v8_object_GetRealNamedPropertyInPrototypeChain, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, GetRealNamedPropertyAttributesInPrototypeChain, arginfo_v8_object_GetRealNamedPropertyAttributesInPrototypeChain, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, GetRealNamedProperty, arginfo_v8_object_GetRealNamedProperty, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, GetRealNamedPropertyAttributes, arginfo_v8_object_GetRealNamedPropertyAttributes, ZEND_ACC_PUBLIC) - - PHP_ME(V8Object, HasNamedLookupInterceptor, arginfo_v8_object_HasNamedLookupInterceptor, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, HasIndexedLookupInterceptor, arginfo_v8_object_HasIndexedLookupInterceptor, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, GetIdentityHash, arginfo_v8_object_GetIdentityHash, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, Clone, arginfo_v8_object_Clone, ZEND_ACC_PUBLIC) - - PHP_ME(V8Object, IsCallable, arginfo_v8_object_IsCallable, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, IsConstructor, arginfo_v8_object_IsConstructor, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, CallAsFunction, arginfo_v8_object_CallAsFunction, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, CallAsConstructor, arginfo_v8_object_CallAsConstructor, ZEND_ACC_PUBLIC) - - PHP_ME(V8Object, AdjustExternalAllocatedMemory, arginfo_v8_object_AdjustExternalAllocatedMemory, ZEND_ACC_PUBLIC) - PHP_ME(V8Object, GetExternalAllocatedMemory, arginfo_v8_object_GetExternalAllocatedMemory, ZEND_ACC_PUBLIC) + PHP_ME(Object, __construct, arginfo_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Object, getContext, arginfo_object_getContext, ZEND_ACC_PUBLIC) + PHP_ME(Object, set, arginfo_object_set, ZEND_ACC_PUBLIC) + PHP_ME(Object, createDataProperty, arginfo_object_createDataProperty, ZEND_ACC_PUBLIC) + PHP_ME(Object, defineOwnProperty, arginfo_object_defineOwnProperty, ZEND_ACC_PUBLIC) + PHP_ME(Object, get, arginfo_object_get, ZEND_ACC_PUBLIC) + PHP_ME(Object, getPropertyAttributes, arginfo_object_getPropertyAttributes, ZEND_ACC_PUBLIC) + PHP_ME(Object, getOwnPropertyDescriptor, arginfo_object_getOwnPropertyDescriptor, ZEND_ACC_PUBLIC) + PHP_ME(Object, has, arginfo_object_has, ZEND_ACC_PUBLIC) + PHP_ME(Object, delete, arginfo_object_delete, ZEND_ACC_PUBLIC) + PHP_ME(Object, setAccessor, arginfo_object_setAccessor, ZEND_ACC_PUBLIC) + PHP_ME(Object, setAccessorProperty, arginfo_php_v8_object_setAccessorProperty, ZEND_ACC_PUBLIC) + PHP_ME(Object, setNativeDataProperty, arginfo_php_v8_object_setNativeDataProperty, ZEND_ACC_PUBLIC) + PHP_ME(Object, getPropertyNames, arginfo_php_v8_object_getPropertyNames, ZEND_ACC_PUBLIC) + PHP_ME(Object, getOwnPropertyNames, arginfo_php_v8_object_getOwnPropertyNames, ZEND_ACC_PUBLIC) + PHP_ME(Object, getPrototype, arginfo_php_v8_object_getPrototype, ZEND_ACC_PUBLIC) + PHP_ME(Object, setPrototype, arginfo_php_v8_object_setPrototype, ZEND_ACC_PUBLIC) + PHP_ME(Object, findInstanceInPrototypeChain, arginfo_php_v8_object_findInstanceInPrototypeChain, ZEND_ACC_PUBLIC) + PHP_ME(Object, objectProtoToString, arginfo_php_v8_object_objectProtoToString, ZEND_ACC_PUBLIC) + PHP_ME(Object, getConstructorName, arginfo_object_getConstructorName, ZEND_ACC_PUBLIC) + PHP_ME(Object, setIntegrityLevel, arginfo_object_setIntegrityLevel, ZEND_ACC_PUBLIC) + + PHP_ME(Object, hasOwnProperty, arginfo_object_hasOwnProperty, ZEND_ACC_PUBLIC) + PHP_ME(Object, hasRealNamedProperty, arginfo_object_hasRealNamedProperty, ZEND_ACC_PUBLIC) + PHP_ME(Object, hasRealIndexedProperty, arginfo_object_hasRealIndexedProperty, ZEND_ACC_PUBLIC) + PHP_ME(Object, hasRealNamedCallbackProperty, arginfo_object_hasRealNamedCallbackProperty, ZEND_ACC_PUBLIC) + + PHP_ME(Object, getRealNamedPropertyInPrototypeChain, arginfo_object_getRealNamedPropertyInPrototypeChain, ZEND_ACC_PUBLIC) + PHP_ME(Object, getRealNamedPropertyAttributesInPrototypeChain, arginfo_object_getRealNamedPropertyAttributesInPrototypeChain, ZEND_ACC_PUBLIC) + PHP_ME(Object, getRealNamedProperty, arginfo_object_getRealNamedProperty, ZEND_ACC_PUBLIC) + PHP_ME(Object, getRealNamedPropertyAttributes, arginfo_object_getRealNamedPropertyAttributes, ZEND_ACC_PUBLIC) + + PHP_ME(Object, hasNamedLookupInterceptor, arginfo_object_hasNamedLookupInterceptor, ZEND_ACC_PUBLIC) + PHP_ME(Object, hasIndexedLookupInterceptor, arginfo_object_hasIndexedLookupInterceptor, ZEND_ACC_PUBLIC) + PHP_ME(Object, getIdentityHash, arginfo_object_getIdentityHash, ZEND_ACC_PUBLIC) + PHP_ME(Object, clone, arginfo_object_clone, ZEND_ACC_PUBLIC) + + PHP_ME(Object, isCallable, arginfo_object_isCallable, ZEND_ACC_PUBLIC) + PHP_ME(Object, isConstructor, arginfo_object_isConstructor, ZEND_ACC_PUBLIC) + PHP_ME(Object, callAsFunction, arginfo_object_callAsFunction, ZEND_ACC_PUBLIC) + PHP_ME(Object, callAsConstructor, arginfo_object_callAsConstructor, ZEND_ACC_PUBLIC) + + PHP_ME(Object, adjustExternalAllocatedMemory, arginfo_object_adjustExternalAllocatedMemory, ZEND_ACC_PUBLIC) + PHP_ME(Object, getExternalAllocatedMemory, arginfo_object_getExternalAllocatedMemory, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_object_template.cc b/src/php_v8_object_template.cc index 82a06c6..9b8af2a 100644 --- a/src/php_v8_object_template.cc +++ b/src/php_v8_object_template.cc @@ -117,7 +117,7 @@ static zend_object * php_v8_object_template_ctor(zend_class_entry *ce) { return &php_v8_object_template->std; } -static PHP_METHOD(V8ObjectTemplate, __construct) { +static PHP_METHOD(ObjectTemplate, __construct) { zval *php_v8_isolate_zv; zval *php_v8_function_template_zv = NULL; v8::Local constructor = v8::Local(); @@ -150,7 +150,7 @@ static PHP_METHOD(V8ObjectTemplate, __construct) { } -static PHP_METHOD(V8ObjectTemplate, GetIsolate) { +static PHP_METHOD(ObjectTemplate, getIsolate) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -165,22 +165,22 @@ static PHP_METHOD(V8ObjectTemplate, GetIsolate) { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static PHP_METHOD(V8ObjectTemplate, Set) { +static PHP_METHOD(ObjectTemplate, set) { php_v8_object_template_Set(INTERNAL_FUNCTION_PARAM_PASSTHRU); } -static PHP_METHOD(V8ObjectTemplate, SetAccessorProperty) { +static PHP_METHOD(ObjectTemplate, setAccessorProperty) { php_v8_object_template_SetAccessorProperty(INTERNAL_FUNCTION_PARAM_PASSTHRU); } -static PHP_METHOD(V8ObjectTemplate, SetNativeDataProperty) { +static PHP_METHOD(ObjectTemplate, setNativeDataProperty) { php_v8_object_template_SetNativeDataProperty(INTERNAL_FUNCTION_PARAM_PASSTHRU); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static PHP_METHOD(V8ObjectTemplate, NewInstance) { +static PHP_METHOD(ObjectTemplate, newInstance) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -206,7 +206,7 @@ static PHP_METHOD(V8ObjectTemplate, NewInstance) { php_v8_get_or_create_value(return_value, local_obj, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8ObjectTemplate, SetAccessor) { +static PHP_METHOD(ObjectTemplate, setAccessor) { zval *php_v8_name_zv; zval *php_v8_receiver_zv = NULL; @@ -280,7 +280,7 @@ static PHP_METHOD(V8ObjectTemplate, SetAccessor) { ); } -static PHP_METHOD(V8ObjectTemplate, SetHandlerForNamedProperty) { +static PHP_METHOD(ObjectTemplate, setHandlerForNamedProperty) { zval *handler_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &handler_zv) == FAILURE) { @@ -312,7 +312,7 @@ static PHP_METHOD(V8ObjectTemplate, SetHandlerForNamedProperty) { ); } -static PHP_METHOD(V8ObjectTemplate, SetHandlerForIndexedProperty) { +static PHP_METHOD(ObjectTemplate, setHandlerForIndexedProperty) { zval *handler_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &handler_zv) == FAILURE) { @@ -344,7 +344,7 @@ static PHP_METHOD(V8ObjectTemplate, SetHandlerForIndexedProperty) { ); } -static PHP_METHOD(V8ObjectTemplate, SetCallAsFunctionHandler) { +static PHP_METHOD(ObjectTemplate, setCallAsFunctionHandler) { zend_fcall_info fci = empty_fcall_info; zend_fcall_info_cache fci_cache = empty_fcall_info_cache; @@ -373,33 +373,33 @@ static PHP_METHOD(V8ObjectTemplate, SetCallAsFunctionHandler) { } /* Non-standard, implementations of AdjustableExternalMemoryInterface::AdjustExternalAllocatedMemory */ -static PHP_METHOD(V8ObjectTemplate, AdjustExternalAllocatedMemory) { +static PHP_METHOD(ObjectTemplate, adjustExternalAllocatedMemory) { php_v8_ext_mem_interface_object_template_AdjustExternalAllocatedMemory(INTERNAL_FUNCTION_PARAM_PASSTHRU); } /* Non-standard, implementations of AdjustableExternalMemoryInterface::GetExternalAllocatedMemory */ -static PHP_METHOD(V8ObjectTemplate, GetExternalAllocatedMemory) { +static PHP_METHOD(ObjectTemplate, getExternalAllocatedMemory) { php_v8_ext_mem_interface_object_template_GetExternalAllocatedMemory(INTERNAL_FUNCTION_PARAM_PASSTHRU); } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_object_template___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_object_template___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_OBJ_INFO(0, constructor, V8\\FunctionTemplate, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_object_template_GetIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_template_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_Set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Data, 0) ZEND_ARG_TYPE_INFO(0, attributes, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_SetAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, getter, V8\\FunctionTemplate, 0) ZEND_ARG_OBJ_INFO(0, setter, V8\\FunctionTemplate, 0) @@ -408,7 +408,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_SetAccessorProperty, ZEND_ ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_SetNativeDataProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setNativeDataProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_CALLABLE_INFO(0, getter, 0) ZEND_ARG_CALLABLE_INFO(0, setter, 1) @@ -419,12 +419,12 @@ ZEND_END_ARG_INFO() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_object_template_NewInstance, ZEND_RETURN_VALUE, 1, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_template_newInstance, ZEND_RETURN_VALUE, 1, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Context, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_SetAccessor, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setAccessor, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_CALLABLE_INFO(0, getter, 0) ZEND_ARG_CALLABLE_INFO(0, setter, 1) @@ -434,47 +434,47 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_SetAccessor, ZEND_SEND_BY_ ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_SetHandlerForNamedProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setHandlerForNamedProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, configuration, V8\\NamedPropertyHandlerConfiguration, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_SetHandlerForIndexedProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setHandlerForIndexedProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, configuration, V8\\IndexedPropertyHandlerConfiguration, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_SetCallAsFunctionHandler, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setCallAsFunctionHandler, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, callback) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_template_AdjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_template_adjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, change_in_bytes, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_object_template_GetExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_template_getExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_object_template_methods[] = { - PHP_ME(V8ObjectTemplate, __construct, arginfo_v8_object_template___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(ObjectTemplate, __construct, arginfo_object_template___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8ObjectTemplate, GetIsolate, arginfo_v8_object_template_GetIsolate, ZEND_ACC_PUBLIC) + PHP_ME(ObjectTemplate, getIsolate, arginfo_object_template_getIsolate, ZEND_ACC_PUBLIC) - PHP_ME(V8ObjectTemplate, Set, arginfo_php_v8_object_template_Set, ZEND_ACC_PUBLIC) - PHP_ME(V8ObjectTemplate, SetAccessorProperty, arginfo_php_v8_object_template_SetAccessorProperty, ZEND_ACC_PUBLIC) - PHP_ME(V8ObjectTemplate, SetNativeDataProperty, arginfo_php_v8_object_template_SetNativeDataProperty, ZEND_ACC_PUBLIC) + PHP_ME(ObjectTemplate, set, arginfo_php_v8_object_template_set, ZEND_ACC_PUBLIC) + PHP_ME(ObjectTemplate, setAccessorProperty, arginfo_php_v8_object_template_setAccessorProperty, ZEND_ACC_PUBLIC) + PHP_ME(ObjectTemplate, setNativeDataProperty, arginfo_php_v8_object_template_setNativeDataProperty, ZEND_ACC_PUBLIC) - PHP_ME(V8ObjectTemplate, NewInstance, arginfo_v8_object_template_NewInstance, ZEND_ACC_PUBLIC) - PHP_ME(V8ObjectTemplate, SetAccessor, arginfo_php_v8_object_template_SetAccessor, ZEND_ACC_PUBLIC) - PHP_ME(V8ObjectTemplate, SetHandlerForNamedProperty, arginfo_php_v8_object_template_SetHandlerForNamedProperty, ZEND_ACC_PUBLIC) - PHP_ME(V8ObjectTemplate, SetHandlerForIndexedProperty, arginfo_php_v8_object_template_SetHandlerForIndexedProperty, ZEND_ACC_PUBLIC) - PHP_ME(V8ObjectTemplate, SetCallAsFunctionHandler, arginfo_php_v8_object_template_SetCallAsFunctionHandler, ZEND_ACC_PUBLIC) + PHP_ME(ObjectTemplate, newInstance, arginfo_object_template_newInstance, ZEND_ACC_PUBLIC) + PHP_ME(ObjectTemplate, setAccessor, arginfo_php_v8_object_template_setAccessor, ZEND_ACC_PUBLIC) + PHP_ME(ObjectTemplate, setHandlerForNamedProperty, arginfo_php_v8_object_template_setHandlerForNamedProperty, ZEND_ACC_PUBLIC) + PHP_ME(ObjectTemplate, setHandlerForIndexedProperty, arginfo_php_v8_object_template_setHandlerForIndexedProperty, ZEND_ACC_PUBLIC) + PHP_ME(ObjectTemplate, setCallAsFunctionHandler, arginfo_php_v8_object_template_setCallAsFunctionHandler, ZEND_ACC_PUBLIC) - PHP_ME(V8ObjectTemplate, AdjustExternalAllocatedMemory, arginfo_v8_object_template_AdjustExternalAllocatedMemory, ZEND_ACC_PUBLIC) - PHP_ME(V8ObjectTemplate, GetExternalAllocatedMemory, arginfo_v8_object_template_GetExternalAllocatedMemory, ZEND_ACC_PUBLIC) + PHP_ME(ObjectTemplate, adjustExternalAllocatedMemory, arginfo_object_template_adjustExternalAllocatedMemory, ZEND_ACC_PUBLIC) + PHP_ME(ObjectTemplate, getExternalAllocatedMemory, arginfo_object_template_getExternalAllocatedMemory, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_property_callback_info.cc b/src/php_v8_property_callback_info.cc index ef8afcf..692a8a1 100644 --- a/src/php_v8_property_callback_info.cc +++ b/src/php_v8_property_callback_info.cc @@ -93,7 +93,7 @@ php_v8_return_value_t *php_v8_callback_info_create_from_info_meta(zval *return_v return php_v8_return_value; } -static PHP_METHOD(PropertyCallbackInfo, ShouldThrowOnError) { +static PHP_METHOD(PropertyCallbackInfo, shouldThrowOnError) { zval rv; zval *tmp; @@ -105,11 +105,11 @@ static PHP_METHOD(PropertyCallbackInfo, ShouldThrowOnError) { ZVAL_COPY(return_value, tmp); } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_property_callback_info_ShouldThrowOnError, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_property_callback_info_shouldThrowOnError, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_property_callback_info_methods[] = { - PHP_ME(PropertyCallbackInfo, ShouldThrowOnError, arginfo_v8_property_callback_info_ShouldThrowOnError, ZEND_ACC_PUBLIC) + PHP_ME(PropertyCallbackInfo, shouldThrowOnError, arginfo_property_callback_info_shouldThrowOnError, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_regexp.cc b/src/php_v8_regexp.cc index 988a2e5..68e94bc 100644 --- a/src/php_v8_regexp.cc +++ b/src/php_v8_regexp.cc @@ -27,7 +27,7 @@ zend_class_entry *php_v8_regexp_flags_class_entry; #define this_ce php_v8_regexp_class_entry -static PHP_METHOD(V8RegExp, __construct) { +static PHP_METHOD(RegExp, __construct) { zval rv; zval *php_v8_context_zv; zval *php_v8_string_zv; @@ -57,7 +57,7 @@ static PHP_METHOD(V8RegExp, __construct) { } -static PHP_METHOD(V8RegExp, GetSource) { +static PHP_METHOD(RegExp, getSource) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -70,7 +70,7 @@ static PHP_METHOD(V8RegExp, GetSource) { php_v8_get_or_create_value(return_value, local_string, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8RegExp, GetFlags) { +static PHP_METHOD(RegExp, getFlags) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -82,24 +82,24 @@ static PHP_METHOD(V8RegExp, GetFlags) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_regexp___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_regexp___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\StringValue, 0) ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_regexp_GetSource, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_regexp_getSource, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_regexp_GetFlags, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_regexp_getFlags, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_regexp_methods[] = { - PHP_ME(V8RegExp, __construct, arginfo_v8_regexp___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(RegExp, __construct, arginfo_regexp___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8RegExp, GetSource, arginfo_v8_regexp_GetSource, ZEND_ACC_PUBLIC) - PHP_ME(V8RegExp, GetFlags, arginfo_v8_regexp_GetFlags, ZEND_ACC_PUBLIC) + PHP_ME(RegExp, getSource, arginfo_regexp_getSource, ZEND_ACC_PUBLIC) + PHP_ME(RegExp, getFlags, arginfo_regexp_getFlags, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_return_value.cc b/src/php_v8_return_value.cc index aec0750..32bca2f 100644 --- a/src/php_v8_return_value.cc +++ b/src/php_v8_return_value.cc @@ -94,7 +94,7 @@ static inline v8::Local php_v8_return_value_get(php_v8_return_value_t } -static PHP_METHOD(V8ReturnValue, Get) { +static PHP_METHOD(ReturnValue, get) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -108,7 +108,7 @@ static PHP_METHOD(V8ReturnValue, Get) { } -static PHP_METHOD(V8ReturnValue, Set) { +static PHP_METHOD(ReturnValue, set) { zval *php_v8_value_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_value_zv) == FAILURE) { @@ -163,7 +163,7 @@ static PHP_METHOD(V8ReturnValue, Set) { } // Fast JS primitive setters -static PHP_METHOD(V8ReturnValue, SetNull) { +static PHP_METHOD(ReturnValue, setNull) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -184,7 +184,7 @@ static PHP_METHOD(V8ReturnValue, SetNull) { PHP_V8_THROW_EXCEPTION("Invalid ReturnValue to set"); } -static PHP_METHOD(V8ReturnValue, SetUndefined) { +static PHP_METHOD(ReturnValue, setUndefined) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -205,7 +205,7 @@ static PHP_METHOD(V8ReturnValue, SetUndefined) { PHP_V8_THROW_EXCEPTION("Invalid ReturnValue to set"); } -static PHP_METHOD(V8ReturnValue, SetEmptyString) { +static PHP_METHOD(ReturnValue, setEmptyString) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -228,7 +228,7 @@ static PHP_METHOD(V8ReturnValue, SetEmptyString) { } // Non-standard primitive setters -static PHP_METHOD(V8ReturnValue, SetBool) { +static PHP_METHOD(ReturnValue, setBool) { zend_bool value; if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &value) == FAILURE) { @@ -256,7 +256,7 @@ static PHP_METHOD(V8ReturnValue, SetBool) { PHP_V8_THROW_EXCEPTION("Invalid ReturnValue to set"); } -static PHP_METHOD(V8ReturnValue, SetInteger) { +static PHP_METHOD(ReturnValue, setInteger) { zend_long value; if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &value) == FAILURE) { @@ -295,7 +295,7 @@ static PHP_METHOD(V8ReturnValue, SetInteger) { } -static PHP_METHOD(V8ReturnValue, SetFloat) { +static PHP_METHOD(ReturnValue, setFloat) { double value; if (zend_parse_parameters(ZEND_NUM_ARGS(), "d", &value) == FAILURE) { @@ -320,7 +320,7 @@ static PHP_METHOD(V8ReturnValue, SetFloat) { // Convenience getter for Isolate -static PHP_METHOD(V8ReturnValue, GetIsolate) { +static PHP_METHOD(ReturnValue, getIsolate) { zval rv; zval *tmp; @@ -333,7 +333,7 @@ static PHP_METHOD(V8ReturnValue, GetIsolate) { } // Convenience getter for Context -static PHP_METHOD(V8ReturnValue, GetContext) { +static PHP_METHOD(ReturnValue, getContext) { zval rv; zval *tmp; @@ -345,7 +345,7 @@ static PHP_METHOD(V8ReturnValue, GetContext) { ZVAL_COPY(return_value, tmp); } -static PHP_METHOD(V8ReturnValue, InContext) { +static PHP_METHOD(ReturnValue, inContext) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -356,54 +356,54 @@ static PHP_METHOD(V8ReturnValue, InContext) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_return_value_Set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, value, V8\\Value, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_return_value_SetNull, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_setNull, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_return_value_SetUndefined, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_setUndefined, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_return_value_SetEmptyString, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_setEmptyString, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_return_value_SetBool, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_setBool, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, value, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_return_value_SetInteger, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_setInteger, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, i, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_return_value_SetFloat, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_setFloat, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, i, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_return_value_GetIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_return_value_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_return_value_GetContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_return_value_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_return_value_InContext, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_return_value_inContext, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_return_value_methods[] = { - PHP_ME(V8ReturnValue, Get, arginfo_v8_return_value_Set, ZEND_ACC_PUBLIC) - PHP_ME(V8ReturnValue, Set, arginfo_v8_return_value_Set, ZEND_ACC_PUBLIC) - PHP_ME(V8ReturnValue, SetNull, arginfo_v8_return_value_SetNull, ZEND_ACC_PUBLIC) - PHP_ME(V8ReturnValue, SetUndefined, arginfo_v8_return_value_SetUndefined, ZEND_ACC_PUBLIC) - PHP_ME(V8ReturnValue, SetEmptyString, arginfo_v8_return_value_SetEmptyString, ZEND_ACC_PUBLIC) - PHP_ME(V8ReturnValue, SetBool, arginfo_v8_return_value_SetBool, ZEND_ACC_PUBLIC) - PHP_ME(V8ReturnValue, SetInteger, arginfo_v8_return_value_SetInteger, ZEND_ACC_PUBLIC) - PHP_ME(V8ReturnValue, SetFloat, arginfo_v8_return_value_SetFloat, ZEND_ACC_PUBLIC) - - PHP_ME(V8ReturnValue, GetIsolate, arginfo_v8_return_value_GetIsolate, ZEND_ACC_PUBLIC) - PHP_ME(V8ReturnValue, GetContext, arginfo_v8_return_value_GetContext, ZEND_ACC_PUBLIC) - PHP_ME(V8ReturnValue, InContext, arginfo_v8_return_value_InContext, ZEND_ACC_PUBLIC) + PHP_ME(ReturnValue, get, arginfo_return_value_set, ZEND_ACC_PUBLIC) + PHP_ME(ReturnValue, set, arginfo_return_value_set, ZEND_ACC_PUBLIC) + PHP_ME(ReturnValue, setNull, arginfo_return_value_setNull, ZEND_ACC_PUBLIC) + PHP_ME(ReturnValue, setUndefined, arginfo_return_value_setUndefined, ZEND_ACC_PUBLIC) + PHP_ME(ReturnValue, setEmptyString, arginfo_return_value_setEmptyString, ZEND_ACC_PUBLIC) + PHP_ME(ReturnValue, setBool, arginfo_return_value_setBool, ZEND_ACC_PUBLIC) + PHP_ME(ReturnValue, setInteger, arginfo_return_value_setInteger, ZEND_ACC_PUBLIC) + PHP_ME(ReturnValue, setFloat, arginfo_return_value_setFloat, ZEND_ACC_PUBLIC) + + PHP_ME(ReturnValue, getIsolate, arginfo_return_value_getIsolate, ZEND_ACC_PUBLIC) + PHP_ME(ReturnValue, getContext, arginfo_return_value_getContext, ZEND_ACC_PUBLIC) + PHP_ME(ReturnValue, inContext, arginfo_return_value_inContext, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_script.cc b/src/php_v8_script.cc index b3c17bb..df09800 100644 --- a/src/php_v8_script.cc +++ b/src/php_v8_script.cc @@ -75,7 +75,7 @@ static zend_object * php_v8_script_ctor(zend_class_entry *ce) return &php_v8_script->std; } -static PHP_METHOD(V8Script, __construct) +static PHP_METHOD(Script, __construct) { zval rv; zval *php_v8_context_zv; @@ -128,7 +128,7 @@ static PHP_METHOD(V8Script, __construct) php_v8_script->persistent->Reset(isolate, maybe_script.ToLocalChecked()); } -static PHP_METHOD(V8Script, GetIsolate) +static PHP_METHOD(Script, getIsolate) { zval rv; @@ -141,7 +141,7 @@ static PHP_METHOD(V8Script, GetIsolate) RETVAL_ZVAL(PHP_V8_SCRIPT_READ_ISOLATE(getThis()), 1, 0); } -static PHP_METHOD(V8Script, GetContext) +static PHP_METHOD(Script, getContext) { zval rv; @@ -154,7 +154,7 @@ static PHP_METHOD(V8Script, GetContext) RETVAL_ZVAL(PHP_V8_SCRIPT_READ_CONTEXT(getThis()), 1, 0); } -static PHP_METHOD(V8Script, Run) +static PHP_METHOD(Script, run) { zval *php_v8_context_zv; @@ -185,7 +185,7 @@ static PHP_METHOD(V8Script, Run) php_v8_get_or_create_value(return_value, local_result, php_v8_script->php_v8_isolate); } -static PHP_METHOD(V8Script, GetUnboundScript) +static PHP_METHOD(Script, getUnboundScript) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -203,33 +203,33 @@ static PHP_METHOD(V8Script, GetUnboundScript) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_script___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_script___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, source, V8\\StringValue, 0) ZEND_ARG_OBJ_INFO(0, origin, V8\\ScriptOrigin, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_script_GetIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_script_GetContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_script_Run, ZEND_RETURN_VALUE, 1, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_run, ZEND_RETURN_VALUE, 1, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_script_GetUnboundScript, ZEND_RETURN_VALUE, 0, V8\\UnboundScript, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_getUnboundScript, ZEND_RETURN_VALUE, 0, V8\\UnboundScript, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_script_methods[] = { - PHP_ME(V8Script, __construct, arginfo_v8_script___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Script, GetIsolate, arginfo_v8_script_GetIsolate, ZEND_ACC_PUBLIC) - PHP_ME(V8Script, GetContext, arginfo_v8_script_GetContext, ZEND_ACC_PUBLIC) + PHP_ME(Script, __construct, arginfo_script___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Script, getIsolate, arginfo_script_getIsolate, ZEND_ACC_PUBLIC) + PHP_ME(Script, getContext, arginfo_script_getContext, ZEND_ACC_PUBLIC) - PHP_ME(V8Script, Run, arginfo_v8_script_Run, ZEND_ACC_PUBLIC) - PHP_ME(V8Script, GetUnboundScript, arginfo_v8_script_GetUnboundScript, ZEND_ACC_PUBLIC) + PHP_ME(Script, run, arginfo_script_run, ZEND_ACC_PUBLIC) + PHP_ME(Script, getUnboundScript, arginfo_script_getUnboundScript, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_script_compiler.cc b/src/php_v8_script_compiler.cc index 6066a35..0d90f18 100644 --- a/src/php_v8_script_compiler.cc +++ b/src/php_v8_script_compiler.cc @@ -60,7 +60,7 @@ static v8::ScriptCompiler::Source * php_v8_build_source(zval *source_string_zv, return source; } -static PHP_METHOD(V8ScriptCompiler, CachedDataVersionTag) +static PHP_METHOD(ScriptCompiler, cachedDataVersionTag) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -69,7 +69,7 @@ static PHP_METHOD(V8ScriptCompiler, CachedDataVersionTag) RETURN_LONG(static_cast(v8::ScriptCompiler::CachedDataVersionTag())); } -static PHP_METHOD(V8ScriptCompiler, CompileUnboundScript) +static PHP_METHOD(ScriptCompiler, compileUnboundScript) { zval rv; @@ -125,7 +125,7 @@ static PHP_METHOD(V8ScriptCompiler, CompileUnboundScript) php_v8_create_unbound_script(return_value, php_v8_context->php_v8_isolate, local_unbound_script); } -static PHP_METHOD(V8ScriptCompiler, Compile) +static PHP_METHOD(ScriptCompiler, compile) { zval rv; @@ -181,7 +181,7 @@ static PHP_METHOD(V8ScriptCompiler, Compile) php_v8_create_script(return_value, local_script, php_v8_context); } -static PHP_METHOD(V8ScriptCompiler, CompileFunctionInContext) +static PHP_METHOD(ScriptCompiler, compileFunctionInContext) { zval rv; @@ -253,22 +253,22 @@ static PHP_METHOD(V8ScriptCompiler, CompileFunctionInContext) } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_script_compiler_CachedDataVersionTag, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_compiler_cachedDataVersionTag, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_script_compiler_CompileUnboundScript, ZEND_RETURN_VALUE, 2, V8\\UnboundScript, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_compiler_compileUnboundScript, ZEND_RETURN_VALUE, 2, V8\\UnboundScript, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, source, V8\\ScriptCompiler\\Source, 0) ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_script_compiler_Compile, ZEND_RETURN_VALUE, 2, V8\\Script, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_compiler_compile, ZEND_RETURN_VALUE, 2, V8\\Script, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, source, V8\\ScriptCompiler\\Source, 0) ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_script_compiler_CompileFunctionInContext, ZEND_RETURN_VALUE, 2, V8\\FunctionObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_compiler_compileFunctionInContext, ZEND_RETURN_VALUE, 2, V8\\FunctionObject, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, source, V8\\ScriptCompiler\\Source, 0) ZEND_ARG_TYPE_INFO(0, arguments, IS_ARRAY, 0) @@ -277,10 +277,10 @@ ZEND_END_ARG_INFO() static const zend_function_entry php_v8_script_compiler_methods[] = { - PHP_ME(V8ScriptCompiler, CachedDataVersionTag, arginfo_v8_script_compiler_CachedDataVersionTag, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8ScriptCompiler, CompileUnboundScript, arginfo_v8_script_compiler_CompileUnboundScript, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8ScriptCompiler, Compile, arginfo_v8_script_compiler_Compile, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8ScriptCompiler, CompileFunctionInContext, arginfo_v8_script_compiler_CompileFunctionInContext, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(ScriptCompiler, cachedDataVersionTag, arginfo_script_compiler_cachedDataVersionTag, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(ScriptCompiler, compileUnboundScript, arginfo_script_compiler_compileUnboundScript, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(ScriptCompiler, compile, arginfo_script_compiler_compile, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(ScriptCompiler, compileFunctionInContext, arginfo_script_compiler_compileFunctionInContext, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/src/php_v8_script_origin.cc b/src/php_v8_script_origin.cc index 10c78fb..4fc6730 100644 --- a/src/php_v8_script_origin.cc +++ b/src/php_v8_script_origin.cc @@ -145,7 +145,7 @@ v8::ScriptOrigin *php_v8_create_script_origin_from_zval(zval *value, v8::Isolate is_module); } -static PHP_METHOD(V8ScriptOrigin, __construct) { +static PHP_METHOD(ScriptOrigin, __construct) { zend_string *resource_name = NULL; zend_long resource_line_offset = static_cast(v8::Message::kNoLineNumberInfo); zend_long resource_column_offset = static_cast(v8::Message::kNoColumnInfo); @@ -194,7 +194,7 @@ static PHP_METHOD(V8ScriptOrigin, __construct) { zval_ptr_dtor(&options_zv); } -static PHP_METHOD(V8ScriptOrigin, ResourceName) { +static PHP_METHOD(ScriptOrigin, resourceName) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -204,7 +204,7 @@ static PHP_METHOD(V8ScriptOrigin, ResourceName) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("resource_name"), 0, &rv), 1, 0); } -static PHP_METHOD(V8ScriptOrigin, ResourceLineOffset) { +static PHP_METHOD(ScriptOrigin, resourceLineOffset) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -214,7 +214,7 @@ static PHP_METHOD(V8ScriptOrigin, ResourceLineOffset) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("resource_line_offset"), 0, &rv), 1, 0); } -static PHP_METHOD(V8ScriptOrigin, ResourceColumnOffset) { +static PHP_METHOD(ScriptOrigin, resourceColumnOffset) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -224,7 +224,7 @@ static PHP_METHOD(V8ScriptOrigin, ResourceColumnOffset) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("resource_column_offset"), 0, &rv), 1, 0); } -static PHP_METHOD(V8ScriptOrigin, ScriptID) { +static PHP_METHOD(ScriptOrigin, scriptID) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -234,7 +234,7 @@ static PHP_METHOD(V8ScriptOrigin, ScriptID) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("script_id"), 0, &rv), 1, 0); } -static PHP_METHOD(V8ScriptOrigin, SourceMapUrl) { +static PHP_METHOD(ScriptOrigin, sourceMapUrl) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -244,7 +244,7 @@ static PHP_METHOD(V8ScriptOrigin, SourceMapUrl) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("source_map_url"), 0, &rv), 1, 0); } -static PHP_METHOD(V8ScriptOrigin, Options) { +static PHP_METHOD(ScriptOrigin, options) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -255,7 +255,7 @@ static PHP_METHOD(V8ScriptOrigin, Options) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_script_origin___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_script_origin___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, resource_name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, resource_line_offset, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, resource_column_offset, IS_LONG, 0) @@ -265,34 +265,34 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_script_origin___construct, ZEND_SEND_BY_VAL, Z ZEND_ARG_TYPE_INFO(0, resource_is_opaque, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_script_origin_ResourceName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_resourceName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_script_origin_ResourceLineOffset, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_resourceLineOffset, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_script_origin_ResourceColumnOffset, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_resourceColumnOffset, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_script_origin_ScriptID, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_scriptID, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_script_origin_SourceMapUrl, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_sourceMapUrl, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_script_origin_Options, ZEND_RETURN_VALUE, 0, V8\\ScriptOriginOptions, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_origin_options, ZEND_RETURN_VALUE, 0, V8\\ScriptOriginOptions, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_script_origin_methods[] = { - PHP_ME(V8ScriptOrigin, __construct, arginfo_v8_script_origin___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(V8ScriptOrigin, ResourceName, arginfo_v8_script_origin_ResourceName, ZEND_ACC_PUBLIC) - PHP_ME(V8ScriptOrigin, ResourceLineOffset, arginfo_v8_script_origin_ResourceLineOffset, ZEND_ACC_PUBLIC) - PHP_ME(V8ScriptOrigin, ResourceColumnOffset, arginfo_v8_script_origin_ResourceColumnOffset, ZEND_ACC_PUBLIC) - PHP_ME(V8ScriptOrigin, ScriptID, arginfo_v8_script_origin_ScriptID, ZEND_ACC_PUBLIC) - PHP_ME(V8ScriptOrigin, SourceMapUrl, arginfo_v8_script_origin_SourceMapUrl, ZEND_ACC_PUBLIC) - PHP_ME(V8ScriptOrigin, Options, arginfo_v8_script_origin_Options, ZEND_ACC_PUBLIC) + PHP_ME(ScriptOrigin, __construct, arginfo_script_origin___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + + PHP_ME(ScriptOrigin, resourceName, arginfo_script_origin_resourceName, ZEND_ACC_PUBLIC) + PHP_ME(ScriptOrigin, resourceLineOffset, arginfo_script_origin_resourceLineOffset, ZEND_ACC_PUBLIC) + PHP_ME(ScriptOrigin, resourceColumnOffset, arginfo_script_origin_resourceColumnOffset, ZEND_ACC_PUBLIC) + PHP_ME(ScriptOrigin, scriptID, arginfo_script_origin_scriptID, ZEND_ACC_PUBLIC) + PHP_ME(ScriptOrigin, sourceMapUrl, arginfo_script_origin_sourceMapUrl, ZEND_ACC_PUBLIC) + PHP_ME(ScriptOrigin, options, arginfo_script_origin_options, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_script_origin_options.cc b/src/php_v8_script_origin_options.cc index 08f0a50..844b95c 100644 --- a/src/php_v8_script_origin_options.cc +++ b/src/php_v8_script_origin_options.cc @@ -31,7 +31,7 @@ void php_v8_create_script_origin_options(zval * return_value, v8::ScriptOriginOp } -static PHP_METHOD(V8ScriptOriginOptions, __construct) { +static PHP_METHOD(ScriptOriginOptions, __construct) { zend_bool is_shared_cross_origin = '\0'; zend_bool is_opaque = '\0'; zend_bool is_wasm = '\0'; @@ -47,7 +47,7 @@ static PHP_METHOD(V8ScriptOriginOptions, __construct) { } -static PHP_METHOD(V8ScriptOriginOptions, IsSharedCrossOrigin) { +static PHP_METHOD(ScriptOriginOptions, isSharedCrossOrigin) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -57,7 +57,7 @@ static PHP_METHOD(V8ScriptOriginOptions, IsSharedCrossOrigin) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("is_shared_cross_origin"), 0, &rv), 1, 0); } -static PHP_METHOD(V8ScriptOriginOptions, IsOpaque) { +static PHP_METHOD(ScriptOriginOptions, isOpaque) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -67,7 +67,7 @@ static PHP_METHOD(V8ScriptOriginOptions, IsOpaque) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("is_opaque"), 0, &rv), 1, 0); } -static PHP_METHOD(V8ScriptOriginOptions, IsWasm) { +static PHP_METHOD(ScriptOriginOptions, isWasm) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -77,7 +77,7 @@ static PHP_METHOD(V8ScriptOriginOptions, IsWasm) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("is_wasm"), 0, &rv), 1, 0); } -static PHP_METHOD(V8ScriptOriginOptions, IsModule) { +static PHP_METHOD(ScriptOriginOptions, isModule) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -88,7 +88,7 @@ static PHP_METHOD(V8ScriptOriginOptions, IsModule) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_script_origin_options___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_script_origin_options___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_ARG_TYPE_INFO(0, is_shared_cross_origin, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, is_opaque, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, is_wasm, _IS_BOOL, 0) @@ -96,26 +96,26 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_script_origin_options___construct, ZEND_SEND_B ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_script_origin_options_IsSharedCrossOrigin, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_options_isSharedCrossOrigin, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_script_origin_options_IsOpaque, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_options_isOpaque, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_script_origin_options_IsWasm, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_options_isWasm, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_script_origin_options_IsModule, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_options_isModule, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_script_origin_options_methods[] = { - PHP_ME(V8ScriptOriginOptions, __construct, arginfo_v8_script_origin_options___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(ScriptOriginOptions, __construct, arginfo_script_origin_options___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8ScriptOriginOptions, IsSharedCrossOrigin, arginfo_v8_script_origin_options_IsSharedCrossOrigin, ZEND_ACC_PUBLIC) - PHP_ME(V8ScriptOriginOptions, IsOpaque, arginfo_v8_script_origin_options_IsOpaque, ZEND_ACC_PUBLIC) - PHP_ME(V8ScriptOriginOptions, IsWasm, arginfo_v8_script_origin_options_IsWasm, ZEND_ACC_PUBLIC) - PHP_ME(V8ScriptOriginOptions, IsModule, arginfo_v8_script_origin_options_IsModule, ZEND_ACC_PUBLIC) + PHP_ME(ScriptOriginOptions, isSharedCrossOrigin, arginfo_script_origin_options_isSharedCrossOrigin, ZEND_ACC_PUBLIC) + PHP_ME(ScriptOriginOptions, isOpaque, arginfo_script_origin_options_isOpaque, ZEND_ACC_PUBLIC) + PHP_ME(ScriptOriginOptions, isWasm, arginfo_script_origin_options_isWasm, ZEND_ACC_PUBLIC) + PHP_ME(ScriptOriginOptions, isModule, arginfo_script_origin_options_isModule, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_set.cc b/src/php_v8_set.cc index 2f822a0..dc469a8 100644 --- a/src/php_v8_set.cc +++ b/src/php_v8_set.cc @@ -24,7 +24,7 @@ zend_class_entry *php_v8_set_class_entry; #define this_ce php_v8_set_class_entry -static PHP_METHOD(V8Set, __construct) { +static PHP_METHOD(Set, __construct) { zval rv; zval *php_v8_context_zv; @@ -43,7 +43,7 @@ static PHP_METHOD(V8Set, __construct) { php_v8_value->persistent->Reset(isolate, local_set); } -static PHP_METHOD(V8Set, Size) { +static PHP_METHOD(Set, size) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -55,7 +55,7 @@ static PHP_METHOD(V8Set, Size) { RETURN_DOUBLE(php_v8_value_get_local_as(php_v8_value)->Size()); } -static PHP_METHOD(V8Set, Clear) { +static PHP_METHOD(Set, clear) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -67,7 +67,7 @@ static PHP_METHOD(V8Set, Clear) { php_v8_value_get_local_as(php_v8_value)->Clear(); } -static PHP_METHOD(V8Set, Add) { +static PHP_METHOD(Set, add) { zval *php_v8_context_zv; zval *php_v8_key_zv; @@ -99,7 +99,7 @@ static PHP_METHOD(V8Set, Add) { ZVAL_COPY(return_value, getThis()); } -static PHP_METHOD(V8Set, Has) { +static PHP_METHOD(Set, has) { zval *php_v8_context_zv; zval *php_v8_key_zv; @@ -131,7 +131,7 @@ static PHP_METHOD(V8Set, Has) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Set, Delete) { +static PHP_METHOD(Set, delete) { zval *php_v8_context_zv; zval *php_v8_key_zv; @@ -163,7 +163,7 @@ static PHP_METHOD(V8Set, Delete) { RETURN_BOOL(maybe_res.FromJust()); } -static PHP_METHOD(V8Set, AsArray) { +static PHP_METHOD(Set, asArray) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -184,46 +184,46 @@ static PHP_METHOD(V8Set, AsArray) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_set___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_set___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_set_Size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_set_Clear, ZEND_RETURN_VALUE, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_set_clear, ZEND_RETURN_VALUE, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_set_Add, ZEND_RETURN_VALUE, 3, V8\\SetObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_set_add, ZEND_RETURN_VALUE, 3, V8\\SetObject, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_set_Has, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_has, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_set_Delete, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_delete, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_set_AsArray, ZEND_RETURN_VALUE, 0, V8\\ArrayObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_set_asArray, ZEND_RETURN_VALUE, 0, V8\\ArrayObject, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_set_methods[] = { - PHP_ME(V8Set, __construct, arginfo_v8_set___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Set, __construct, arginfo_set___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Set, Size, arginfo_v8_set_Size, ZEND_ACC_PUBLIC) - PHP_ME(V8Set, Clear, arginfo_v8_set_Clear, ZEND_ACC_PUBLIC) + PHP_ME(Set, size, arginfo_set_size, ZEND_ACC_PUBLIC) + PHP_ME(Set, clear, arginfo_set_clear, ZEND_ACC_PUBLIC) - PHP_ME(V8Set, Add, arginfo_v8_set_Add, ZEND_ACC_PUBLIC) - PHP_ME(V8Set, Has, arginfo_v8_set_Has, ZEND_ACC_PUBLIC) - PHP_ME(V8Set, Delete, arginfo_v8_set_Delete, ZEND_ACC_PUBLIC) + PHP_ME(Set, add, arginfo_set_add, ZEND_ACC_PUBLIC) + PHP_ME(Set, has, arginfo_set_has, ZEND_ACC_PUBLIC) + PHP_ME(Set, delete, arginfo_set_delete, ZEND_ACC_PUBLIC) - PHP_ME(V8Set, AsArray, arginfo_v8_set_AsArray, ZEND_ACC_PUBLIC) + PHP_ME(Set, asArray, arginfo_set_asArray, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_source.cc b/src/php_v8_source.cc index 385e44b..6b8044e 100644 --- a/src/php_v8_source.cc +++ b/src/php_v8_source.cc @@ -42,7 +42,7 @@ void php_v8_update_source_cached_data(zval *src_zv, v8::ScriptCompiler::Source * Z_DELREF(tmp); } -static PHP_METHOD(V8Source, __construct) +static PHP_METHOD(Source, __construct) { zval *source_string_zv = NULL; zval *origin_zv = NULL; @@ -65,7 +65,7 @@ static PHP_METHOD(V8Source, __construct) } } -static PHP_METHOD(V8Source, GetSourceString) +static PHP_METHOD(Source, getSourceString) { zval rv; @@ -76,7 +76,7 @@ static PHP_METHOD(V8Source, GetSourceString) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("source_string"), 0, &rv), 1, 0); } -static PHP_METHOD(V8Source, GetScriptOrigin) +static PHP_METHOD(Source, getScriptOrigin) { zval rv; @@ -87,7 +87,7 @@ static PHP_METHOD(V8Source, GetScriptOrigin) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("origin"), 0, &rv), 1, 0); } -static PHP_METHOD(V8Source, GetCachedData) +static PHP_METHOD(Source, getCachedData) { zval rv; @@ -99,27 +99,27 @@ static PHP_METHOD(V8Source, GetCachedData) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_source___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_source___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, source_string, V8\\StringValue, 0) ZEND_ARG_OBJ_INFO(0, origin, V8\\ScriptOrigin, 1) ZEND_ARG_OBJ_INFO(0, cached_data, V8\\ScriptCompiler\\CachedData, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_source_GetSourceString, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_source_getSourceString, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_source_GetScriptOrigin, ZEND_RETURN_VALUE, 0, V8\\ScriptOrigin, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_source_getScriptOrigin, ZEND_RETURN_VALUE, 0, V8\\ScriptOrigin, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_source_GetCachedData, ZEND_RETURN_VALUE, 0, V8\\ScriptCompiler\\CachedData, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_source_getCachedData, ZEND_RETURN_VALUE, 0, V8\\ScriptCompiler\\CachedData, 1) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_source_methods[] = { - PHP_ME(V8Source, __construct, arginfo_v8_source___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Source, GetSourceString, arginfo_v8_source_GetSourceString, ZEND_ACC_PUBLIC) - PHP_ME(V8Source, GetScriptOrigin, arginfo_v8_source_GetScriptOrigin, ZEND_ACC_PUBLIC) - PHP_ME(V8Source, GetCachedData, arginfo_v8_source_GetCachedData, ZEND_ACC_PUBLIC) + PHP_ME(Source, __construct, arginfo_source___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Source, getSourceString, arginfo_source_getSourceString, ZEND_ACC_PUBLIC) + PHP_ME(Source, getScriptOrigin, arginfo_source_getScriptOrigin, ZEND_ACC_PUBLIC) + PHP_ME(Source, getCachedData, arginfo_source_getCachedData, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_stack_frame.cc b/src/php_v8_stack_frame.cc index f964476..99e9b0d 100644 --- a/src/php_v8_stack_frame.cc +++ b/src/php_v8_stack_frame.cc @@ -68,7 +68,7 @@ void php_v8_stack_frame_create_from_stack_frame(zval *return_value, v8::Local(frame->IsConstructor())); } -static PHP_METHOD(V8StackFrame, __construct) { +static PHP_METHOD(StackFrame, __construct) { zend_long line_number = static_cast(v8::Message::kNoLineNumberInfo); zend_long column = static_cast(v8::Message::kNoColumnInfo); zend_long script_id = static_cast(v8::Message::kNoScriptIdInfo); @@ -107,7 +107,7 @@ static PHP_METHOD(V8StackFrame, __construct) { zend_update_property_bool(this_ce, getThis(), ZEND_STRL("is_constructor"), is_constructor); } -static PHP_METHOD(V8StackFrame, GetLineNumber) { +static PHP_METHOD(StackFrame, getLineNumber) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -117,7 +117,7 @@ static PHP_METHOD(V8StackFrame, GetLineNumber) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("line_number"), 0, &rv), 1, 0); } -static PHP_METHOD(V8StackFrame, GetColumn) { +static PHP_METHOD(StackFrame, getColumn) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -127,7 +127,7 @@ static PHP_METHOD(V8StackFrame, GetColumn) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("column"), 0, &rv), 1, 0); } -static PHP_METHOD(V8StackFrame, GetScriptId) { +static PHP_METHOD(StackFrame, getScriptId) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -137,7 +137,7 @@ static PHP_METHOD(V8StackFrame, GetScriptId) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("script_id"), 0, &rv), 1, 0); } -static PHP_METHOD(V8StackFrame, GetScriptName) { +static PHP_METHOD(StackFrame, getScriptName) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -147,7 +147,7 @@ static PHP_METHOD(V8StackFrame, GetScriptName) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("script_name"), 0, &rv), 1, 0); } -static PHP_METHOD(V8StackFrame, GetScriptNameOrSourceURL) { +static PHP_METHOD(StackFrame, getScriptNameOrSourceURL) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -157,7 +157,7 @@ static PHP_METHOD(V8StackFrame, GetScriptNameOrSourceURL) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("script_name_or_source_url"), 0, &rv), 1, 0); } -static PHP_METHOD(V8StackFrame, GetFunctionName) { +static PHP_METHOD(StackFrame, getFunctionName) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -167,7 +167,7 @@ static PHP_METHOD(V8StackFrame, GetFunctionName) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("function_name"), 0, &rv), 1, 0); } -static PHP_METHOD(V8StackFrame, IsEval) { +static PHP_METHOD(StackFrame, isEval) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -177,7 +177,7 @@ static PHP_METHOD(V8StackFrame, IsEval) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("is_eval"), 0, &rv), 1, 0); } -static PHP_METHOD(V8StackFrame, IsConstructor) { +static PHP_METHOD(StackFrame, isConstructor) { zval rv; if (zend_parse_parameters_none() == FAILURE) { @@ -187,7 +187,7 @@ static PHP_METHOD(V8StackFrame, IsConstructor) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("is_constructor"), 0, &rv), 1, 0); } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_stack_frame___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_stack_frame___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_ARG_TYPE_INFO(0, line_number, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, column, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, script_id, IS_LONG, 0) @@ -198,44 +198,44 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_stack_frame___construct, ZEND_SEND_BY_VAL, ZEN ZEND_ARG_TYPE_INFO(0, is_constructor, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_stack_frame_GetLineNumber, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_getLineNumber, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_stack_frame_GetColumn, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_getColumn, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_stack_frame_GetScriptId, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_getScriptId, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_stack_frame_GetScriptName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_getScriptName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_stack_frame_GetScriptNameOrSourceURL, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_getScriptNameOrSourceURL, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_stack_frame_GetFunctionName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_getFunctionName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_stack_frame_IsEval, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_isEval, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_stack_frame_IsConstructor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_isConstructor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_stack_frame_methods[] = { - PHP_ME(V8StackFrame, __construct, arginfo_v8_stack_frame___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(StackFrame, __construct, arginfo_stack_frame___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8StackFrame, GetLineNumber, arginfo_v8_stack_frame_GetLineNumber, ZEND_ACC_PUBLIC) - PHP_ME(V8StackFrame, GetColumn, arginfo_v8_stack_frame_GetColumn, ZEND_ACC_PUBLIC) - PHP_ME(V8StackFrame, GetScriptId, arginfo_v8_stack_frame_GetScriptId, ZEND_ACC_PUBLIC) + PHP_ME(StackFrame, getLineNumber, arginfo_stack_frame_getLineNumber, ZEND_ACC_PUBLIC) + PHP_ME(StackFrame, getColumn, arginfo_stack_frame_getColumn, ZEND_ACC_PUBLIC) + PHP_ME(StackFrame, getScriptId, arginfo_stack_frame_getScriptId, ZEND_ACC_PUBLIC) - PHP_ME(V8StackFrame, GetScriptName, arginfo_v8_stack_frame_GetScriptName, ZEND_ACC_PUBLIC) - PHP_ME(V8StackFrame, GetScriptNameOrSourceURL, arginfo_v8_stack_frame_GetScriptNameOrSourceURL, ZEND_ACC_PUBLIC) - PHP_ME(V8StackFrame, GetFunctionName, arginfo_v8_stack_frame_GetFunctionName, ZEND_ACC_PUBLIC) + PHP_ME(StackFrame, getScriptName, arginfo_stack_frame_getScriptName, ZEND_ACC_PUBLIC) + PHP_ME(StackFrame, getScriptNameOrSourceURL, arginfo_stack_frame_getScriptNameOrSourceURL, ZEND_ACC_PUBLIC) + PHP_ME(StackFrame, getFunctionName, arginfo_stack_frame_getFunctionName, ZEND_ACC_PUBLIC) - PHP_ME(V8StackFrame, IsEval, arginfo_v8_stack_frame_IsEval, ZEND_ACC_PUBLIC) - PHP_ME(V8StackFrame, IsConstructor, arginfo_v8_stack_frame_IsConstructor, ZEND_ACC_PUBLIC) + PHP_ME(StackFrame, isEval, arginfo_stack_frame_isEval, ZEND_ACC_PUBLIC) + PHP_ME(StackFrame, isConstructor, arginfo_stack_frame_isConstructor, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_stack_trace.cc b/src/php_v8_stack_trace.cc index 920dfd4..c680ad4 100644 --- a/src/php_v8_stack_trace.cc +++ b/src/php_v8_stack_trace.cc @@ -50,7 +50,7 @@ void php_v8_stack_trace_create_from_stack_trace(zval *return_value, php_v8_isola zval_ptr_dtor(&frames_array_zv); } -static PHP_METHOD(V8StackTrace, __construct) +static PHP_METHOD(StackTrace, __construct) { zval *frames_zv = NULL; @@ -63,7 +63,7 @@ static PHP_METHOD(V8StackTrace, __construct) zend_update_property(this_ce, getThis(), ZEND_STRL("frames"), frames_zv); } -static PHP_METHOD(V8StackTrace, getFrames) +static PHP_METHOD(StackTrace, getFrames) { zval rv; @@ -74,7 +74,7 @@ static PHP_METHOD(V8StackTrace, getFrames) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("frames"), 0, &rv), 1, 0); } -static PHP_METHOD(V8StackTrace, GetFrame) +static PHP_METHOD(StackTrace, getFrame) { zval rv; @@ -103,7 +103,7 @@ static PHP_METHOD(V8StackTrace, GetFrame) RETVAL_ZVAL(frame, 1, 0); } -static PHP_METHOD(V8StackTrace, GetFrameCount) +static PHP_METHOD(StackTrace, getFrameCount) { zval rv; uint32_t cnt = 0; @@ -121,7 +121,7 @@ static PHP_METHOD(V8StackTrace, GetFrameCount) RETURN_LONG(cnt); } -static PHP_METHOD(V8StackTrace, CurrentStackTrace) +static PHP_METHOD(StackTrace, currentStackTrace) { zval *isolate_zv; zend_long frame_limit = 0; @@ -142,35 +142,35 @@ static PHP_METHOD(V8StackTrace, CurrentStackTrace) php_v8_stack_trace_create_from_stack_trace(return_value, php_v8_isolate, trace); } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_stack_trace___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_stack_trace___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, frames, IS_ARRAY, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_stack_trace_getFrames, ZEND_RETURN_VALUE, 0, IS_ARRAY, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_trace_getFrames, ZEND_RETURN_VALUE, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_stack_trace_GetFrame, ZEND_RETURN_VALUE, 1, V8\\StackFrame, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_stack_trace_getFrame, ZEND_RETURN_VALUE, 1, V8\\StackFrame, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_stack_trace_GetFrameCount, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_trace_getFrameCount, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_stack_trace_CurrentStackTrace, ZEND_RETURN_VALUE, 2, V8\\StackTrace, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_stack_trace_currentStackTrace, ZEND_RETURN_VALUE, 2, V8\\StackTrace, 0) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_TYPE_INFO(0, frame_limit, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_stack_trace_methods[] = { - PHP_ME(V8StackTrace, __construct, arginfo_v8_stack_trace___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(StackTrace, __construct, arginfo_stack_trace___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8StackTrace, getFrames, arginfo_v8_stack_trace_getFrames, ZEND_ACC_PUBLIC) + PHP_ME(StackTrace, getFrames, arginfo_stack_trace_getFrames, ZEND_ACC_PUBLIC) - PHP_ME(V8StackTrace, GetFrame, arginfo_v8_stack_trace_GetFrame, ZEND_ACC_PUBLIC) - PHP_ME(V8StackTrace, GetFrameCount, arginfo_v8_stack_trace_GetFrameCount, ZEND_ACC_PUBLIC) + PHP_ME(StackTrace, getFrame, arginfo_stack_trace_getFrame, ZEND_ACC_PUBLIC) + PHP_ME(StackTrace, getFrameCount, arginfo_stack_trace_getFrameCount, ZEND_ACC_PUBLIC) - PHP_ME(V8StackTrace, CurrentStackTrace, arginfo_v8_stack_trace_CurrentStackTrace, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(StackTrace, currentStackTrace, arginfo_stack_trace_currentStackTrace, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/src/php_v8_startup_data.cc b/src/php_v8_startup_data.cc index 941b83a..7e89d7d 100644 --- a/src/php_v8_startup_data.cc +++ b/src/php_v8_startup_data.cc @@ -61,7 +61,7 @@ static zend_object *php_v8_startup_data_ctor(zend_class_entry *ce) { return &php_v8_startup_data->std; } -static PHP_METHOD(V8StartupData, __construct) { +static PHP_METHOD(StartupData, __construct) { zend_string *blob_string = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &blob_string) == FAILURE) { @@ -86,7 +86,7 @@ static PHP_METHOD(V8StartupData, __construct) { php_v8_startup_data->blob = new phpv8::StartupData(blob); } -static PHP_METHOD(V8StartupData, GetData) { +static PHP_METHOD(StartupData, getData) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -101,7 +101,7 @@ static PHP_METHOD(V8StartupData, GetData) { RETURN_EMPTY_STRING(); } -static PHP_METHOD(V8StartupData, GetRawSize) { +static PHP_METHOD(StartupData, getRawSize) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -116,7 +116,7 @@ static PHP_METHOD(V8StartupData, GetRawSize) { RETURN_LONG(0); } -static PHP_METHOD(V8StartupData, CreateFromSource) { +static PHP_METHOD(StartupData, createFromSource) { zend_string *blob = NULL; if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &blob) == FAILURE) { @@ -141,28 +141,28 @@ static PHP_METHOD(V8StartupData, CreateFromSource) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_startup_data___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_startup_data___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, blob, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_startup_data_GetData, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_startup_data_getData, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_startup_data_GetRawSize, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_startup_data_getRawSize, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_startup_data_CreateFromSource, ZEND_RETURN_VALUE, 1, V8\\StartupData, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_startup_data_createFromSource, ZEND_RETURN_VALUE, 1, V8\\StartupData, 0) ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_startup_data_methods[] = { - PHP_ME(V8StartupData, __construct, arginfo_v8_startup_data___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(StartupData, __construct, arginfo_startup_data___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8StartupData, GetData, arginfo_v8_startup_data_GetData, ZEND_ACC_PUBLIC) - PHP_ME(V8StartupData, GetRawSize, arginfo_v8_startup_data_GetRawSize, ZEND_ACC_PUBLIC) + PHP_ME(StartupData, getData, arginfo_startup_data_getData, ZEND_ACC_PUBLIC) + PHP_ME(StartupData, getRawSize, arginfo_startup_data_getRawSize, ZEND_ACC_PUBLIC) - PHP_ME(V8StartupData, CreateFromSource, arginfo_v8_startup_data_CreateFromSource, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(StartupData, createFromSource, arginfo_startup_data_createFromSource, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/src/php_v8_string.cc b/src/php_v8_string.cc index c2412a0..4a85086 100644 --- a/src/php_v8_string.cc +++ b/src/php_v8_string.cc @@ -23,7 +23,7 @@ zend_class_entry* php_v8_string_class_entry; #define this_ce php_v8_string_class_entry -static PHP_METHOD(V8String, __construct) { +static PHP_METHOD(String, __construct) { zval *php_v8_isolate_zv; zend_string *string = NULL; @@ -48,7 +48,7 @@ static PHP_METHOD(V8String, __construct) { php_v8_value->persistent->Reset(isolate, str_tpl_checked); } -static PHP_METHOD(V8String, Value) +static PHP_METHOD(String, value) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -67,7 +67,7 @@ static PHP_METHOD(V8String, Value) } -static PHP_METHOD(V8String, Length) +static PHP_METHOD(String, length) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -82,7 +82,7 @@ static PHP_METHOD(V8String, Length) } -static PHP_METHOD(V8String, Utf8Length) +static PHP_METHOD(String, utf8Length) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -97,7 +97,7 @@ static PHP_METHOD(V8String, Utf8Length) } -static PHP_METHOD(V8String, IsOneByte) +static PHP_METHOD(String, isOneByte) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -112,7 +112,7 @@ static PHP_METHOD(V8String, IsOneByte) } -static PHP_METHOD(V8String, ContainsOnlyOneByte) +static PHP_METHOD(String, containsOnlyOneByte) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -127,34 +127,34 @@ static PHP_METHOD(V8String, ContainsOnlyOneByte) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_string___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_string___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_string_Value, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string_value, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_string_Length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string_length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_string_Utf8Length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string_utf8Length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_string_IsOneByte, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string_isOneByte, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_string_ContainsOnlyOneByte, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string_containsOnlyOneByte, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_string_methods[] = { - PHP_ME(V8String, __construct, arginfo_v8_string___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8String, Value, arginfo_v8_string_Value, ZEND_ACC_PUBLIC) - PHP_ME(V8String, Length, arginfo_v8_string_Length, ZEND_ACC_PUBLIC) - PHP_ME(V8String, Utf8Length, arginfo_v8_string_Utf8Length, ZEND_ACC_PUBLIC) - PHP_ME(V8String, IsOneByte, arginfo_v8_string_IsOneByte, ZEND_ACC_PUBLIC) - PHP_ME(V8String, ContainsOnlyOneByte, arginfo_v8_string_ContainsOnlyOneByte, ZEND_ACC_PUBLIC) + PHP_ME(String, __construct, arginfo_string___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(String, value, arginfo_string_value, ZEND_ACC_PUBLIC) + PHP_ME(String, length, arginfo_string_length, ZEND_ACC_PUBLIC) + PHP_ME(String, utf8Length, arginfo_string_utf8Length, ZEND_ACC_PUBLIC) + PHP_ME(String, isOneByte, arginfo_string_isOneByte, ZEND_ACC_PUBLIC) + PHP_ME(String, containsOnlyOneByte, arginfo_string_containsOnlyOneByte, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_string_object.cc b/src/php_v8_string_object.cc index 456353f..45bbb5f 100644 --- a/src/php_v8_string_object.cc +++ b/src/php_v8_string_object.cc @@ -25,7 +25,7 @@ zend_class_entry *php_v8_string_object_class_entry; #define this_ce php_v8_string_object_class_entry -static PHP_METHOD(V8StringObject, __construct) { +static PHP_METHOD(StringObject, __construct) { zval rv; zval *php_v8_context_zv; zval *php_v8_string_zv; @@ -48,7 +48,7 @@ static PHP_METHOD(V8StringObject, __construct) { php_v8_value->persistent->Reset(isolate, local_string_obj); } -static PHP_METHOD(V8StringObject, ValueOf) { +static PHP_METHOD(StringObject, valueOf) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -62,19 +62,19 @@ static PHP_METHOD(V8StringObject, ValueOf) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_string_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_string_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\StringValue, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_string_object_ValueOf, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_string_object_valueOf, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_string_object_methods[] = { - PHP_ME(V8StringObject, __construct, arginfo_v8_string_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(StringObject, __construct, arginfo_string_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8StringObject, ValueOf, arginfo_v8_string_object_ValueOf, ZEND_ACC_PUBLIC) + PHP_ME(StringObject, valueOf, arginfo_string_object_valueOf, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_symbol.cc b/src/php_v8_symbol.cc index 7bfae52..2620bc9 100644 --- a/src/php_v8_symbol.cc +++ b/src/php_v8_symbol.cc @@ -24,7 +24,7 @@ zend_class_entry* php_v8_symbol_class_entry; #define this_ce php_v8_symbol_class_entry -static PHP_METHOD(V8Symbol, __construct) { +static PHP_METHOD(Symbol, __construct) { zval *php_v8_isolate_zv; zval *php_v8_string_zv = NULL; @@ -53,7 +53,7 @@ static PHP_METHOD(V8Symbol, __construct) { php_v8_value->persistent->Reset(isolate, local_symbol); } -static PHP_METHOD(V8Symbol, Value) +static PHP_METHOD(Symbol, value) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -76,7 +76,7 @@ static PHP_METHOD(V8Symbol, Value) RETVAL_STRINGL(cstr, str.length()); } -static PHP_METHOD(V8Symbol, Name) +static PHP_METHOD(Symbol, name) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -91,7 +91,7 @@ static PHP_METHOD(V8Symbol, Name) php_v8_get_or_create_value(return_value, local_name, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Symbol, For) +static PHP_METHOD(Symbol, for) { zval *php_v8_context_zv; zval *php_v8_name_zv; @@ -115,7 +115,7 @@ static PHP_METHOD(V8Symbol, For) php_v8_get_or_create_value(return_value, local_symbol, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Symbol, ForApi) +static PHP_METHOD(Symbol, forApi) { zval *php_v8_context_zv; zval *php_v8_name_zv; @@ -142,7 +142,7 @@ static PHP_METHOD(V8Symbol, ForApi) // Well-known symbols #define PHP_V8_SYMBOL_WELL_KNOWN_METHOD(classname, name) \ - PHP_METHOD(classname, name) \ + PHP_METHOD(classname, get##name) \ { \ zval *php_v8_isolate_zv; \ \ @@ -153,42 +153,42 @@ static PHP_METHOD(V8Symbol, ForApi) PHP_V8_ISOLATE_FETCH_WITH_CHECK(php_v8_isolate_zv, php_v8_isolate); \ PHP_V8_ENTER_ISOLATE(php_v8_isolate); \ \ - v8::Local local_symbol = v8::Symbol::name(isolate); \ + v8::Local local_symbol = v8::Symbol::Get##name(isolate); \ \ PHP_V8_THROW_VALUE_EXCEPTION_WHEN_EMPTY(local_symbol, "Failed to create Symbol value"); \ \ php_v8_get_or_create_value(return_value, local_symbol, php_v8_isolate); \ } \ -static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(V8Symbol, GetHasInstance); -static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(V8Symbol, GetIsConcatSpreadable); -static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(V8Symbol, GetIterator); -static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(V8Symbol, GetMatch); -static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(V8Symbol, GetReplace); -static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(V8Symbol, GetSearch); -static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(V8Symbol, GetSplit); -static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(V8Symbol, GetToPrimitive); -static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(V8Symbol, GetToStringTag); -static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(V8Symbol, GetUnscopables); +static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(Symbol, HasInstance); +static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(Symbol, IsConcatSpreadable); +static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(Symbol, Iterator); +static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(Symbol, Match); +static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(Symbol, Replace); +static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(Symbol, Search); +static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(Symbol, Split); +static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(Symbol, ToPrimitive); +static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(Symbol, ToStringTag); +static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(Symbol, Unscopables); -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_symbol___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_symbol___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_OBJ_INFO(0, name, V8\\StringValue, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_symbol_Value, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_symbol_value, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_symbol_Name, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_symbol_name, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_symbol_For, ZEND_RETURN_VALUE, 2, V8\\SymbolValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_symbol_for, ZEND_RETURN_VALUE, 2, V8\\SymbolValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, name, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_symbol_ForApi, ZEND_RETURN_VALUE, 2, V8\\SymbolValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_symbol_forApi, ZEND_RETURN_VALUE, 2, V8\\SymbolValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, name, V8\\StringValue, 0) ZEND_END_ARG_INFO() @@ -199,39 +199,39 @@ ZEND_END_ARG_INFO() ZEND_END_ARG_INFO() \ // Well-known symbols -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_v8_symbol_GetHasInstance); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_v8_symbol_GetIsConcatSpreadable); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_v8_symbol_GetIterator); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_v8_symbol_GetMatch); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_v8_symbol_GetReplace); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_v8_symbol_GetSearch); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_v8_symbol_GetSplit); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_v8_symbol_GetToPrimitive); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_v8_symbol_GetToStringTag); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_v8_symbol_GetUnscopables); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getHasInstance); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getIsConcatSpreadable); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getIterator); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getMatch); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getReplace); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getSearch); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getSplit); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getToPrimitive); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getToStringTag); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getUnscopables); static const zend_function_entry php_v8_symbol_methods[] = { - PHP_ME(V8Symbol, __construct, arginfo_v8_symbol___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Symbol, __construct, arginfo_symbol___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Symbol, Value, arginfo_v8_symbol_Value, ZEND_ACC_PUBLIC) + PHP_ME(Symbol, value, arginfo_symbol_value, ZEND_ACC_PUBLIC) - PHP_ME(V8Symbol, Name, arginfo_v8_symbol_Name, ZEND_ACC_PUBLIC) + PHP_ME(Symbol, name, arginfo_symbol_name, ZEND_ACC_PUBLIC) - PHP_ME(V8Symbol, For, arginfo_v8_symbol_For, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Symbol, ForApi, arginfo_v8_symbol_ForApi, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Symbol, for, arginfo_symbol_for, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Symbol, forApi, arginfo_symbol_forApi, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) // Well-known symbols - PHP_ME(V8Symbol, GetHasInstance, arginfo_v8_symbol_GetHasInstance, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Symbol, GetIsConcatSpreadable, arginfo_v8_symbol_GetIsConcatSpreadable, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Symbol, GetIterator, arginfo_v8_symbol_GetIterator, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Symbol, GetMatch, arginfo_v8_symbol_GetMatch, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Symbol, GetReplace, arginfo_v8_symbol_GetReplace, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Symbol, GetSearch, arginfo_v8_symbol_GetSearch, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Symbol, GetSplit, arginfo_v8_symbol_GetSplit, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Symbol, GetToPrimitive, arginfo_v8_symbol_GetToPrimitive, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Symbol, GetToStringTag, arginfo_v8_symbol_GetToStringTag, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(V8Symbol, GetUnscopables, arginfo_v8_symbol_GetUnscopables, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Symbol, getHasInstance, arginfo_symbol_getHasInstance, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Symbol, getIsConcatSpreadable, arginfo_symbol_getIsConcatSpreadable, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Symbol, getIterator, arginfo_symbol_getIterator, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Symbol, getMatch, arginfo_symbol_getMatch, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Symbol, getReplace, arginfo_symbol_getReplace, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Symbol, getSearch, arginfo_symbol_getSearch, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Symbol, getSplit, arginfo_symbol_getSplit, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Symbol, getToPrimitive, arginfo_symbol_getToPrimitive, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Symbol, getToStringTag, arginfo_symbol_getToStringTag, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_ME(Symbol, getUnscopables, arginfo_symbol_getUnscopables, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/src/php_v8_symbol_object.cc b/src/php_v8_symbol_object.cc index eb1367d..bf7487e 100644 --- a/src/php_v8_symbol_object.cc +++ b/src/php_v8_symbol_object.cc @@ -24,7 +24,7 @@ zend_class_entry *php_v8_symbol_object_class_entry; #define this_ce php_v8_symbol_object_class_entry -static PHP_METHOD(V8SymbolObject, __construct) { +static PHP_METHOD(SymbolObject, __construct) { zval rv; zval *php_v8_context_zv; zval *php_v8_symbol_zv; @@ -48,7 +48,7 @@ static PHP_METHOD(V8SymbolObject, __construct) { php_v8_value->persistent->Reset(isolate, local_symbol_obj); } -static PHP_METHOD(V8SymbolObject, ValueOf) { +static PHP_METHOD(SymbolObject, valueOf) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -63,19 +63,19 @@ static PHP_METHOD(V8SymbolObject, ValueOf) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_symbol_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_symbol_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\SymbolValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_symbol_object_ValueOf, ZEND_RETURN_VALUE, 0, V8\\SymbolValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_symbol_object_valueOf, ZEND_RETURN_VALUE, 0, V8\\SymbolValue, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_symbol_object_methods[] = { - PHP_ME(V8SymbolObject, __construct, arginfo_v8_symbol_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(SymbolObject, __construct, arginfo_symbol_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8SymbolObject, ValueOf, arginfo_v8_symbol_object_ValueOf, ZEND_ACC_PUBLIC) + PHP_ME(SymbolObject, valueOf, arginfo_symbol_object_valueOf, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_template.cc b/src/php_v8_template.cc index f3ce352..8ae692a 100644 --- a/src/php_v8_template.cc +++ b/src/php_v8_template.cc @@ -291,16 +291,16 @@ void php_v8_template_SetNativeDataProperty(v8::Isolate *isolate, v8::Local lo } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_template_GetIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_template_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_template_Set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_template_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Data, 0) ZEND_ARG_TYPE_INFO(0, attributes, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_template_SetAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_template_setAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, getter, V8\\FunctionTemplate, 0) ZEND_ARG_OBJ_INFO(0, setter, V8\\FunctionTemplate, 0) @@ -308,7 +308,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_template_SetAccessorProperty, ZEND_SEND_BY ZEND_ARG_TYPE_INFO(0, settings, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_template_SetNativeDataProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_template_setNativeDataProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_CALLABLE_INFO(0, getter, 0) ZEND_ARG_CALLABLE_INFO(0, setter, 1) @@ -318,10 +318,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_template_SetNativeDataProperty, ZEND_SEND_ ZEND_END_ARG_INFO() static const zend_function_entry php_v8_template_methods[] = { - PHP_ABSTRACT_ME(V8Template, GetIsolate, arginfo_v8_template_GetIsolate) - PHP_ABSTRACT_ME(V8Template, Set, arginfo_php_v8_template_Set) - PHP_ABSTRACT_ME(V8Template, SetAccessorProperty, arginfo_php_v8_template_SetAccessorProperty) - PHP_ABSTRACT_ME(V8Template, SetNativeDataProperty, arginfo_php_v8_template_SetNativeDataProperty) + PHP_ABSTRACT_ME(Template, getIsolate, arginfo_template_getIsolate) + PHP_ABSTRACT_ME(Template, set, arginfo_php_v8_template_set) + PHP_ABSTRACT_ME(Template, setAccessorProperty, arginfo_php_v8_template_setAccessorProperty) + PHP_ABSTRACT_ME(Template, setNativeDataProperty, arginfo_php_v8_template_setNativeDataProperty) PHP_FE_END }; diff --git a/src/php_v8_try_catch.cc b/src/php_v8_try_catch.cc index a1dc595..4fc2eb5 100644 --- a/src/php_v8_try_catch.cc +++ b/src/php_v8_try_catch.cc @@ -72,7 +72,7 @@ void php_v8_try_catch_create_from_try_catch(zval *return_value, php_v8_isolate_t } -static PHP_METHOD(V8TryCatch, __construct) { +static PHP_METHOD(TryCatch, __construct) { zval *php_v8_isolate_zv; zval *php_v8_context_zv; zval *php_v8_exception_zv = NULL; @@ -129,7 +129,7 @@ static PHP_METHOD(V8TryCatch, __construct) { } } -static PHP_METHOD(V8TryCatch, GetIsolate) +static PHP_METHOD(TryCatch, getIsolate) { zval rv; @@ -140,7 +140,7 @@ static PHP_METHOD(V8TryCatch, GetIsolate) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("isolate"), 0, &rv), 1, 0); } -static PHP_METHOD(V8TryCatch, GetContext) +static PHP_METHOD(TryCatch, getContext) { zval rv; @@ -151,7 +151,7 @@ static PHP_METHOD(V8TryCatch, GetContext) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("context"), 0, &rv), 1, 0); } -static PHP_METHOD(V8TryCatch, Exception) +static PHP_METHOD(TryCatch, exception) { zval rv; zval *prop; @@ -165,7 +165,7 @@ static PHP_METHOD(V8TryCatch, Exception) RETVAL_ZVAL(prop, 1, 0); } -static PHP_METHOD(V8TryCatch, StackTrace) +static PHP_METHOD(TryCatch, stackTrace) { zval rv; zval *prop; @@ -179,7 +179,7 @@ static PHP_METHOD(V8TryCatch, StackTrace) RETVAL_ZVAL(prop, 1, 0); } -static PHP_METHOD(V8TryCatch, Message) +static PHP_METHOD(TryCatch, message) { zval rv; zval *prop; @@ -193,7 +193,7 @@ static PHP_METHOD(V8TryCatch, Message) RETVAL_ZVAL(prop, 1, 0); } -static PHP_METHOD(V8TryCatch, CanContinue) +static PHP_METHOD(TryCatch, canContinue) { zval rv; @@ -204,7 +204,7 @@ static PHP_METHOD(V8TryCatch, CanContinue) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("can_continue"), 0, &rv), 1, 0); } -static PHP_METHOD(V8TryCatch, HasTerminated) +static PHP_METHOD(TryCatch, hasTerminated) { zval rv; @@ -216,7 +216,7 @@ static PHP_METHOD(V8TryCatch, HasTerminated) } -static PHP_METHOD(V8TryCatch, getExternalException) +static PHP_METHOD(TryCatch, getExternalException) { zval rv; @@ -228,7 +228,7 @@ static PHP_METHOD(V8TryCatch, getExternalException) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_try_catch___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_try_catch___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, exception, V8\\Value, 1) @@ -239,45 +239,45 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_try_catch___construct, ZEND_SEND_BY_VAL, ZEND_ ZEND_ARG_OBJ_INFO(0, external_exception, Throwable, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_try_catch_GetIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_try_catch_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_try_catch_GetContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_try_catch_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_try_catch_Exception, ZEND_RETURN_VALUE, 0, V8\\Value, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_try_catch_exception, ZEND_RETURN_VALUE, 0, V8\\Value, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_try_catch_StackTrace, ZEND_RETURN_VALUE, 0, V8\\Value, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_try_catch_stackTrace, ZEND_RETURN_VALUE, 0, V8\\Value, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_try_catch_Message, ZEND_RETURN_VALUE, 0, V8\\Message, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_try_catch_message, ZEND_RETURN_VALUE, 0, V8\\Message, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_try_catch_CanContinue, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_try_catch_canContinue, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_try_catch_HasTerminated, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_try_catch_hasTerminated, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_try_catch_getExternalException, ZEND_RETURN_VALUE, 0, Throwable, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_try_catch_getExternalException, ZEND_RETURN_VALUE, 0, Throwable, 1) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_try_catch_methods[] = { - PHP_ME(V8TryCatch, __construct, arginfo_v8_try_catch___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(TryCatch, __construct, arginfo_try_catch___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8TryCatch, GetIsolate, arginfo_v8_try_catch_GetIsolate, ZEND_ACC_PUBLIC) - PHP_ME(V8TryCatch, GetContext, arginfo_v8_try_catch_GetContext, ZEND_ACC_PUBLIC) + PHP_ME(TryCatch, getIsolate, arginfo_try_catch_getIsolate, ZEND_ACC_PUBLIC) + PHP_ME(TryCatch, getContext, arginfo_try_catch_getContext, ZEND_ACC_PUBLIC) - PHP_ME(V8TryCatch, Exception, arginfo_v8_try_catch_Exception, ZEND_ACC_PUBLIC) - PHP_ME(V8TryCatch, StackTrace, arginfo_v8_try_catch_StackTrace, ZEND_ACC_PUBLIC) - PHP_ME(V8TryCatch, Message, arginfo_v8_try_catch_Message, ZEND_ACC_PUBLIC) + PHP_ME(TryCatch, exception, arginfo_try_catch_exception, ZEND_ACC_PUBLIC) + PHP_ME(TryCatch, stackTrace, arginfo_try_catch_stackTrace, ZEND_ACC_PUBLIC) + PHP_ME(TryCatch, message, arginfo_try_catch_message, ZEND_ACC_PUBLIC) - PHP_ME(V8TryCatch, CanContinue, arginfo_v8_try_catch_CanContinue, ZEND_ACC_PUBLIC) - PHP_ME(V8TryCatch, HasTerminated, arginfo_v8_try_catch_HasTerminated, ZEND_ACC_PUBLIC) + PHP_ME(TryCatch, canContinue, arginfo_try_catch_canContinue, ZEND_ACC_PUBLIC) + PHP_ME(TryCatch, hasTerminated, arginfo_try_catch_hasTerminated, ZEND_ACC_PUBLIC) - PHP_ME(V8TryCatch, getExternalException, arginfo_v8_try_catch_getExternalException, ZEND_ACC_PUBLIC) + PHP_ME(TryCatch, getExternalException, arginfo_try_catch_getExternalException, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_uint32.cc b/src/php_v8_uint32.cc index bbb81c5..6716945 100644 --- a/src/php_v8_uint32.cc +++ b/src/php_v8_uint32.cc @@ -23,7 +23,7 @@ zend_class_entry *php_v8_uint32_class_entry; #define this_ce php_v8_uint32_class_entry -static PHP_METHOD(V8Uint32, __construct) { +static PHP_METHOD(Uint32, __construct) { zval *php_v8_isolate_zv; zend_long value = 0; @@ -44,7 +44,7 @@ static PHP_METHOD(V8Uint32, __construct) { } -static PHP_METHOD(V8Uint32, Value) { +static PHP_METHOD(Uint32, value) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -58,18 +58,18 @@ static PHP_METHOD(V8Uint32, Value) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_uint32___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_uint32___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_uint32_Value, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_uint32_value, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_uint32_methods[] = { - PHP_ME(V8Uint32, __construct, arginfo_v8_uint32___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Uint32, Value, arginfo_v8_uint32_Value, ZEND_ACC_PUBLIC) + PHP_ME(Uint32, __construct, arginfo_uint32___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Uint32, value, arginfo_uint32_value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_unbound_script.cc b/src/php_v8_unbound_script.cc index aa4aced..15cf7ad 100644 --- a/src/php_v8_unbound_script.cc +++ b/src/php_v8_unbound_script.cc @@ -75,7 +75,7 @@ static zend_object * php_v8_unbound_script_ctor(zend_class_entry *ce) return &php_v8_unbound_script->std; } -static PHP_METHOD(V8UnboundScript, __construct) +static PHP_METHOD(UnboundScript, __construct) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -84,7 +84,7 @@ static PHP_METHOD(V8UnboundScript, __construct) PHP_V8_THROW_EXCEPTION("V8\\UnboundScript::__construct() should not be called. Use other methods which yield V8\\UnboundScript object.") } -static PHP_METHOD(V8UnboundScript, GetIsolate) +static PHP_METHOD(UnboundScript, getIsolate) { zval rv; @@ -97,7 +97,7 @@ static PHP_METHOD(V8UnboundScript, GetIsolate) RETVAL_ZVAL(PHP_V8_UNBOUND_SCRIPT_READ_ISOLATE(getThis()), 1, 0); } -static PHP_METHOD(V8UnboundScript, BindToContext) +static PHP_METHOD(UnboundScript, bindToContext) { zval *php_v8_context_zv; @@ -119,7 +119,7 @@ static PHP_METHOD(V8UnboundScript, BindToContext) php_v8_create_script(return_value, local_script, php_v8_context); } -static PHP_METHOD(V8UnboundScript, GetId) +static PHP_METHOD(UnboundScript, getId) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -133,7 +133,7 @@ static PHP_METHOD(V8UnboundScript, GetId) RETURN_LONG(static_cast(local_unbound_script->GetId())); } -static PHP_METHOD(V8UnboundScript, GetScriptName) +static PHP_METHOD(UnboundScript, getScriptName) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -147,7 +147,7 @@ static PHP_METHOD(V8UnboundScript, GetScriptName) php_v8_get_or_create_value(return_value, local_unbound_script->GetScriptName(), php_v8_unbound_script->php_v8_isolate); } -static PHP_METHOD(V8UnboundScript, GetSourceURL) +static PHP_METHOD(UnboundScript, getSourceURL) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -161,7 +161,7 @@ static PHP_METHOD(V8UnboundScript, GetSourceURL) php_v8_get_or_create_value(return_value, local_unbound_script->GetSourceURL(), php_v8_unbound_script->php_v8_isolate); } -static PHP_METHOD(V8UnboundScript, GetSourceMappingURL) +static PHP_METHOD(UnboundScript, getSourceMappingURL) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -175,7 +175,7 @@ static PHP_METHOD(V8UnboundScript, GetSourceMappingURL) php_v8_get_or_create_value(return_value, local_unbound_script->GetSourceMappingURL(), php_v8_unbound_script->php_v8_isolate); } -static PHP_METHOD(V8UnboundScript, GetLineNumber) +static PHP_METHOD(UnboundScript, getLineNumber) { zend_long code_pos = 0; @@ -194,42 +194,42 @@ static PHP_METHOD(V8UnboundScript, GetLineNumber) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_unbound_script___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_unbound_script___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_unbound_script_GetIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_unbound_script_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_unbound_script_BindToContext, ZEND_RETURN_VALUE, 1, V8\\Script, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_unbound_script_bindToContext, ZEND_RETURN_VALUE, 1, V8\\Script, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_unbound_script_GetId, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_unbound_script_getId, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_unbound_script_GetScriptName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_unbound_script_getScriptName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_unbound_script_GetSourceURL, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_unbound_script_getSourceURL, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_unbound_script_GetSourceMappingURL, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_unbound_script_getSourceMappingURL, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_unbound_script_GetLineNumber, ZEND_RETURN_VALUE, 1, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_unbound_script_getLineNumber, ZEND_RETURN_VALUE, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, code_pos, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_unbound_script_methods[] = { - PHP_ME(V8UnboundScript, __construct, arginfo_v8_unbound_script___construct, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) - PHP_ME(V8UnboundScript, GetIsolate, arginfo_v8_unbound_script_GetIsolate, ZEND_ACC_PUBLIC) - PHP_ME(V8UnboundScript, BindToContext, arginfo_v8_unbound_script_BindToContext, ZEND_ACC_PUBLIC) - PHP_ME(V8UnboundScript, GetId, arginfo_v8_unbound_script_GetId, ZEND_ACC_PUBLIC) - PHP_ME(V8UnboundScript, GetScriptName, arginfo_v8_unbound_script_GetScriptName, ZEND_ACC_PUBLIC) - PHP_ME(V8UnboundScript, GetSourceURL, arginfo_v8_unbound_script_GetSourceURL, ZEND_ACC_PUBLIC) - PHP_ME(V8UnboundScript, GetSourceMappingURL, arginfo_v8_unbound_script_GetSourceMappingURL, ZEND_ACC_PUBLIC) - PHP_ME(V8UnboundScript, GetLineNumber, arginfo_v8_unbound_script_GetLineNumber, ZEND_ACC_PUBLIC) + PHP_ME(UnboundScript, __construct, arginfo_unbound_script___construct, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) + PHP_ME(UnboundScript, getIsolate, arginfo_unbound_script_getIsolate, ZEND_ACC_PUBLIC) + PHP_ME(UnboundScript, bindToContext, arginfo_unbound_script_bindToContext, ZEND_ACC_PUBLIC) + PHP_ME(UnboundScript, getId, arginfo_unbound_script_getId, ZEND_ACC_PUBLIC) + PHP_ME(UnboundScript, getScriptName, arginfo_unbound_script_getScriptName, ZEND_ACC_PUBLIC) + PHP_ME(UnboundScript, getSourceURL, arginfo_unbound_script_getSourceURL, ZEND_ACC_PUBLIC) + PHP_ME(UnboundScript, getSourceMappingURL, arginfo_unbound_script_getSourceMappingURL, ZEND_ACC_PUBLIC) + PHP_ME(UnboundScript, getLineNumber, arginfo_unbound_script_getLineNumber, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_undefined.cc b/src/php_v8_undefined.cc index 4f28e11..2da4fde 100644 --- a/src/php_v8_undefined.cc +++ b/src/php_v8_undefined.cc @@ -23,7 +23,7 @@ zend_class_entry *php_v8_undefined_class_entry; #define this_ce php_v8_undefined_class_entry -static PHP_METHOD(V8Undefined, __construct) { +static PHP_METHOD(Undefined, __construct) { zval *php_v8_isolate_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_isolate_zv) == FAILURE) { @@ -35,7 +35,7 @@ static PHP_METHOD(V8Undefined, __construct) { php_v8_value->persistent->Reset(isolate, v8::Undefined(isolate)); } -static PHP_METHOD(V8Undefined, Value) +static PHP_METHOD(Undefined, value) { if (zend_parse_parameters_none() == FAILURE) { return; @@ -46,17 +46,17 @@ static PHP_METHOD(V8Undefined, Value) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_undefined___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_undefined___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_undefined_Value, ZEND_RETURN_VALUE, 0, IS_NULL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_undefined_value, ZEND_RETURN_VALUE, 0, IS_NULL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_undefined_methods[] = { - PHP_ME(V8Undefined, __construct, arginfo_v8_undefined___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(V8Undefined, Value, arginfo_v8_undefined_Value, ZEND_ACC_PUBLIC) + PHP_ME(Undefined, __construct, arginfo_undefined___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_ME(Undefined, value, arginfo_undefined_value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_value.cc b/src/php_v8_value.cc index 5e9245e..bb31d3c 100644 --- a/src/php_v8_value.cc +++ b/src/php_v8_value.cc @@ -329,7 +329,7 @@ php_v8_value_t *php_v8_get_or_create_value(zval *return_value, v8::Localname()); \ + RETURN_BOOL(php_v8_value_get_local(php_v8_value)->Is##name()); \ } \ -static PHP_V8_VALUE_IS_METHOD(V8Value, IsUndefined) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsNull) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsNullOrUndefined) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsTrue) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsFalse) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsName) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsString) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsSymbol) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsFunction) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsArray) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsObject) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsBoolean) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsNumber) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsInt32) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsUint32) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsDate) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsArgumentsObject) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsBooleanObject) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsNumberObject) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsStringObject) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsSymbolObject) - -static PHP_METHOD(V8Value, IsNativeError) { +static PHP_V8_VALUE_IS_METHOD(Value, Undefined) +static PHP_V8_VALUE_IS_METHOD(Value, Null) +static PHP_V8_VALUE_IS_METHOD(Value, NullOrUndefined) +static PHP_V8_VALUE_IS_METHOD(Value, True) +static PHP_V8_VALUE_IS_METHOD(Value, False) +static PHP_V8_VALUE_IS_METHOD(Value, Name) +static PHP_V8_VALUE_IS_METHOD(Value, String) +static PHP_V8_VALUE_IS_METHOD(Value, Symbol) +static PHP_V8_VALUE_IS_METHOD(Value, Function) +static PHP_V8_VALUE_IS_METHOD(Value, Array) +static PHP_V8_VALUE_IS_METHOD(Value, Object) +static PHP_V8_VALUE_IS_METHOD(Value, Boolean) +static PHP_V8_VALUE_IS_METHOD(Value, Number) +static PHP_V8_VALUE_IS_METHOD(Value, Int32) +static PHP_V8_VALUE_IS_METHOD(Value, Uint32) +static PHP_V8_VALUE_IS_METHOD(Value, Date) +static PHP_V8_VALUE_IS_METHOD(Value, ArgumentsObject) +static PHP_V8_VALUE_IS_METHOD(Value, BooleanObject) +static PHP_V8_VALUE_IS_METHOD(Value, NumberObject) +static PHP_V8_VALUE_IS_METHOD(Value, StringObject) +static PHP_V8_VALUE_IS_METHOD(Value, SymbolObject) + +static PHP_METHOD(Value, isNativeError) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -402,41 +402,41 @@ static PHP_METHOD(V8Value, IsNativeError) { RETURN_BOOL(local->IsNativeError()); } -static PHP_V8_VALUE_IS_METHOD(V8Value, IsRegExp) - -static PHP_V8_VALUE_IS_METHOD(V8Value, IsAsyncFunction) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsGeneratorFunction) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsGeneratorObject) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsPromise) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsMap) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsSet) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsMapIterator) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsSetIterator) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsWeakMap) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsWeakSet) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsArrayBuffer) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsArrayBufferView) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsTypedArray) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsUint8Array) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsUint8ClampedArray) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsInt8Array) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsUint16Array) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsInt16Array) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsUint32Array) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsInt32Array) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsFloat32Array) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsFloat64Array) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsDataView) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsSharedArrayBuffer) -static PHP_V8_VALUE_IS_METHOD(V8Value, IsProxy) -//static PHP_V8_VALUE_IS_METHOD(V8Value, IsWebAssemblyCompiledModule) // Experimental +static PHP_V8_VALUE_IS_METHOD(Value, RegExp) + +static PHP_V8_VALUE_IS_METHOD(Value, AsyncFunction) +static PHP_V8_VALUE_IS_METHOD(Value, GeneratorFunction) +static PHP_V8_VALUE_IS_METHOD(Value, GeneratorObject) +static PHP_V8_VALUE_IS_METHOD(Value, Promise) +static PHP_V8_VALUE_IS_METHOD(Value, Map) +static PHP_V8_VALUE_IS_METHOD(Value, Set) +static PHP_V8_VALUE_IS_METHOD(Value, MapIterator) +static PHP_V8_VALUE_IS_METHOD(Value, SetIterator) +static PHP_V8_VALUE_IS_METHOD(Value, WeakMap) +static PHP_V8_VALUE_IS_METHOD(Value, WeakSet) +static PHP_V8_VALUE_IS_METHOD(Value, ArrayBuffer) +static PHP_V8_VALUE_IS_METHOD(Value, ArrayBufferView) +static PHP_V8_VALUE_IS_METHOD(Value, TypedArray) +static PHP_V8_VALUE_IS_METHOD(Value, Uint8Array) +static PHP_V8_VALUE_IS_METHOD(Value, Uint8ClampedArray) +static PHP_V8_VALUE_IS_METHOD(Value, Int8Array) +static PHP_V8_VALUE_IS_METHOD(Value, Uint16Array) +static PHP_V8_VALUE_IS_METHOD(Value, Int16Array) +static PHP_V8_VALUE_IS_METHOD(Value, Uint32Array) +static PHP_V8_VALUE_IS_METHOD(Value, Int32Array) +static PHP_V8_VALUE_IS_METHOD(Value, Float32Array) +static PHP_V8_VALUE_IS_METHOD(Value, Float64Array) +static PHP_V8_VALUE_IS_METHOD(Value, DataView) +static PHP_V8_VALUE_IS_METHOD(Value, SharedArrayBuffer) +static PHP_V8_VALUE_IS_METHOD(Value, Proxy) +//static PHP_V8_VALUE_IS_METHOD(Value, WebAssemblyCompiledModule) // Experimental /* ----------------------------------------------------------------------- Converters from v8::Value to high-level v8::Value's children ----------------------------------------------------------------------- */ -static PHP_METHOD(V8Value, ToBoolean) { +static PHP_METHOD(Value, toBoolean) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -464,7 +464,7 @@ static PHP_METHOD(V8Value, ToBoolean) { php_v8_get_or_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Value, ToNumber) { +static PHP_METHOD(Value, toNumber) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -492,7 +492,7 @@ static PHP_METHOD(V8Value, ToNumber) { php_v8_get_or_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Value, ToString) { +static PHP_METHOD(Value, toString) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -520,7 +520,7 @@ static PHP_METHOD(V8Value, ToString) { php_v8_get_or_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Value, ToDetailString) { +static PHP_METHOD(Value, toDetailString) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -548,7 +548,7 @@ static PHP_METHOD(V8Value, ToDetailString) { php_v8_get_or_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Value, ToObject) { +static PHP_METHOD(Value, toObject) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -576,7 +576,7 @@ static PHP_METHOD(V8Value, ToObject) { php_v8_get_or_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Value, ToInteger) { +static PHP_METHOD(Value, toInteger) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -604,7 +604,7 @@ static PHP_METHOD(V8Value, ToInteger) { php_v8_get_or_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Value, ToUint32) { +static PHP_METHOD(Value, toUint32) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -632,7 +632,7 @@ static PHP_METHOD(V8Value, ToUint32) { php_v8_get_or_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Value, ToInt32) { +static PHP_METHOD(Value, toInt32) { zval *php_v8_context_zv; @@ -661,7 +661,7 @@ static PHP_METHOD(V8Value, ToInt32) { php_v8_get_or_create_value(return_value, local_value, php_v8_context->php_v8_isolate); } -static PHP_METHOD(V8Value, ToArrayIndex) { +static PHP_METHOD(Value, toArrayIndex) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -695,7 +695,7 @@ static PHP_METHOD(V8Value, ToArrayIndex) { ----------------------------------------------------------------------- */ -static PHP_METHOD(V8Value, BooleanValue) { +static PHP_METHOD(Value, booleanValue) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -720,7 +720,7 @@ static PHP_METHOD(V8Value, BooleanValue) { RETVAL_BOOL(maybe.FromJust()); } -static PHP_METHOD(V8Value, NumberValue) { +static PHP_METHOD(Value, numberValue) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -742,7 +742,7 @@ static PHP_METHOD(V8Value, NumberValue) { RETVAL_DOUBLE(maybe.FromJust()); } -static PHP_METHOD(V8Value, IntegerValue) { +static PHP_METHOD(Value, integerValue) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -764,7 +764,7 @@ static PHP_METHOD(V8Value, IntegerValue) { RETVAL_DOUBLE((double) maybe.FromJust()); } -static PHP_METHOD(V8Value, Uint32Value) { +static PHP_METHOD(Value, uint32Value) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -786,7 +786,7 @@ static PHP_METHOD(V8Value, Uint32Value) { RETVAL_LONG((zend_long) maybe.FromJust()); } -static PHP_METHOD(V8Value, Int32Value) { +static PHP_METHOD(Value, int32Value) { zval *php_v8_context_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_context_zv) == FAILURE) { @@ -810,7 +810,7 @@ static PHP_METHOD(V8Value, Int32Value) { /** JS == */ -static PHP_METHOD(V8Value, Equals) { +static PHP_METHOD(Value, equals) { zval *php_v8_context_zv; zval *php_v8_value_that_zv; @@ -839,7 +839,7 @@ static PHP_METHOD(V8Value, Equals) { RETVAL_BOOL(maybe.FromJust()); } -static PHP_METHOD(V8Value, StrictEquals) { +static PHP_METHOD(Value, strictEquals) { zval *php_v8_value_that_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_value_that_zv) == FAILURE) { @@ -858,7 +858,7 @@ static PHP_METHOD(V8Value, StrictEquals) { RETVAL_BOOL(val); } -static PHP_METHOD(V8Value, SameValue) { +static PHP_METHOD(Value, sameValue) { zval *php_v8_value_that_zv; if (zend_parse_parameters(ZEND_NUM_ARGS(), "o", &php_v8_value_that_zv) == FAILURE) { @@ -877,7 +877,7 @@ static PHP_METHOD(V8Value, SameValue) { RETVAL_BOOL(val); } -static PHP_METHOD(V8Value, TypeOf) { +static PHP_METHOD(Value, typeOf) { if (zend_parse_parameters_none() == FAILURE) { return; } @@ -893,7 +893,7 @@ static PHP_METHOD(V8Value, TypeOf) { php_v8_get_or_create_value(return_value, local_string, php_v8_value->php_v8_isolate); } -static PHP_METHOD(V8Value, InstanceOf) { +static PHP_METHOD(Value, instanceOf) { zval *php_v8_context_zv; zval *php_v8_value_object_zv; @@ -923,224 +923,224 @@ static PHP_METHOD(V8Value, InstanceOf) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_value_GetIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_value_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() #define PHP_V8_VALUE_IS_METHOD_ARG_INFO(method) \ - PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_value_##method, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) \ + PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value_is##method, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) \ ZEND_END_ARG_INFO() \ -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsUndefined) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsNull) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsNullOrUndefined) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsTrue) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsFalse) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsName) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsString) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsSymbol) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsFunction) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsArray) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsObject) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsBoolean) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsNumber) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsInt32) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsUint32) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsDate) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsArgumentsObject) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsBooleanObject) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsNumberObject) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsStringObject) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsSymbolObject) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsNativeError) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsRegExp) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsAsyncFunction) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsGeneratorFunction) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsGeneratorObject) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsPromise) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsMap) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsSet) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsMapIterator) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsSetIterator) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsWeakMap) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsWeakSet) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsArrayBuffer) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsArrayBufferView) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsTypedArray) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsUint8Array) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsUint8ClampedArray) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsInt8Array) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsUint16Array) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsInt16Array) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsUint32Array) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsInt32Array) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsFloat32Array) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsFloat64Array) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsDataView) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsSharedArrayBuffer) -PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsProxy) -//PHP_V8_VALUE_IS_METHOD_ARG_INFO(IsWebAssemblyCompiledModule) // Experimental - - -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_ToBoolean, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Undefined) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Null) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(NullOrUndefined) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(True) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(False) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Name) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(String) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Symbol) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Function) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Array) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Object) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Boolean) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Number) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Int32) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Uint32) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Date) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(ArgumentsObject) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(BooleanObject) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(NumberObject) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(StringObject) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(SymbolObject) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(NativeError) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(RegExp) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(AsyncFunction) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(GeneratorFunction) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(GeneratorObject) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Promise) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Map) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Set) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(MapIterator) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(SetIterator) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(WeakMap) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(WeakSet) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(ArrayBuffer) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(ArrayBufferView) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(TypedArray) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Uint8Array) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Uint8ClampedArray) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Int8Array) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Uint16Array) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Int16Array) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Uint32Array) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Int32Array) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Float32Array) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Float64Array) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(DataView) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(SharedArrayBuffer) +PHP_V8_VALUE_IS_METHOD_ARG_INFO(Proxy) +//PHP_V8_VALUE_IS_METHOD_ARG_INFO(WebAssemblyCompiledModule) // Experimental + + +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toBoolean, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_ToNumber, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toNumber, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_ToString, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toString, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_ToDetailString, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toDetailString, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_ToObject, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toObject, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_ToInteger, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toInteger, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_ToUint32, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toUint32, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_ToInt32, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toInt32, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_ToArrayIndex, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toArrayIndex, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_BooleanValue, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_booleanValue, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_NumberValue, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_numberValue, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_IntegerValue, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_integerValue, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_Int32Value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_int32Value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_v8_value_Uint32Value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value_uint32Value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_value_Equals, ZEND_RETURN_VALUE, 2, _IS_BOOL, 2) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value_equals, ZEND_RETURN_VALUE, 2, _IS_BOOL, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, that, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_value_StrictEquals, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value_strictEquals, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, that, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_value_SameValue, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value_sameValue, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, that, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_v8_value_TypeOf, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_value_typeOf, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_v8_value_InstanceOf, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value_instanceOf, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, object, V8\\ObjectValue, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_value_methods[] = { -// PHP_ME(V8Value, __construct, arginfo_v8_value___construct, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) - - PHP_ME(V8Value, GetIsolate, arginfo_v8_value_GetIsolate, ZEND_ACC_PUBLIC) - - PHP_ME(V8Value, IsUndefined, arginfo_v8_value_IsUndefined, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsNull, arginfo_v8_value_IsNull, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsNullOrUndefined, arginfo_v8_value_IsNullOrUndefined, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsTrue, arginfo_v8_value_IsTrue, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsFalse, arginfo_v8_value_IsFalse, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsName, arginfo_v8_value_IsName, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsString, arginfo_v8_value_IsString, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsSymbol, arginfo_v8_value_IsSymbol, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsFunction, arginfo_v8_value_IsFunction, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsArray, arginfo_v8_value_IsArray, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsObject, arginfo_v8_value_IsObject, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsBoolean, arginfo_v8_value_IsBoolean, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsNumber, arginfo_v8_value_IsNumber, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsInt32, arginfo_v8_value_IsInt32, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsUint32, arginfo_v8_value_IsUint32, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsDate, arginfo_v8_value_IsDate, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsArgumentsObject, arginfo_v8_value_IsArgumentsObject, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsBooleanObject, arginfo_v8_value_IsBooleanObject, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsNumberObject, arginfo_v8_value_IsNumberObject, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsStringObject, arginfo_v8_value_IsStringObject, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsSymbolObject, arginfo_v8_value_IsSymbolObject, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsNativeError, arginfo_v8_value_IsNativeError, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsRegExp, arginfo_v8_value_IsRegExp, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsAsyncFunction, arginfo_v8_value_IsAsyncFunction, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsGeneratorFunction, arginfo_v8_value_IsGeneratorFunction, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsGeneratorObject, arginfo_v8_value_IsGeneratorObject, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsPromise, arginfo_v8_value_IsPromise, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsMap, arginfo_v8_value_IsMap, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsSet, arginfo_v8_value_IsSet, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsMapIterator, arginfo_v8_value_IsMapIterator, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsSetIterator, arginfo_v8_value_IsSetIterator, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsWeakMap, arginfo_v8_value_IsWeakMap, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsWeakSet, arginfo_v8_value_IsWeakSet, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsArrayBuffer, arginfo_v8_value_IsArrayBuffer, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsArrayBufferView, arginfo_v8_value_IsArrayBufferView, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsTypedArray, arginfo_v8_value_IsTypedArray, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsUint8Array, arginfo_v8_value_IsUint8Array, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsUint8ClampedArray, arginfo_v8_value_IsUint8ClampedArray, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsInt8Array, arginfo_v8_value_IsInt8Array, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsUint16Array, arginfo_v8_value_IsUint16Array, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsInt16Array, arginfo_v8_value_IsInt16Array, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsUint32Array, arginfo_v8_value_IsUint32Array, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsInt32Array, arginfo_v8_value_IsInt32Array, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsFloat32Array, arginfo_v8_value_IsFloat32Array, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsFloat64Array, arginfo_v8_value_IsFloat64Array, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsDataView, arginfo_v8_value_IsDataView, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsSharedArrayBuffer, arginfo_v8_value_IsSharedArrayBuffer, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IsProxy, arginfo_v8_value_IsProxy, ZEND_ACC_PUBLIC) - //PHP_ME(V8Value, IsWebAssemblyCompiledModule, arginfo_v8_value_IsWebAssemblyCompiledModule, ZEND_ACC_PUBLIC) // Experimental - - PHP_ME(V8Value, ToBoolean, arginfo_v8_value_ToBoolean, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, ToNumber, arginfo_v8_value_ToNumber, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, ToString, arginfo_v8_value_ToString, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, ToDetailString, arginfo_v8_value_ToDetailString, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, ToObject, arginfo_v8_value_ToObject, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, ToInteger, arginfo_v8_value_ToInteger, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, ToUint32, arginfo_v8_value_ToUint32, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, ToInt32, arginfo_v8_value_ToInt32, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, ToArrayIndex, arginfo_v8_value_ToArrayIndex, ZEND_ACC_PUBLIC) - - PHP_ME(V8Value, BooleanValue, arginfo_v8_value_BooleanValue, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, NumberValue, arginfo_v8_value_NumberValue, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, IntegerValue, arginfo_v8_value_IntegerValue, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, Int32Value, arginfo_v8_value_Int32Value, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, Uint32Value, arginfo_v8_value_Uint32Value, ZEND_ACC_PUBLIC) - - PHP_ME(V8Value, Equals, arginfo_v8_value_Equals, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, StrictEquals, arginfo_v8_value_StrictEquals, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, SameValue, arginfo_v8_value_SameValue, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, TypeOf, arginfo_v8_value_TypeOf, ZEND_ACC_PUBLIC) - PHP_ME(V8Value, InstanceOf, arginfo_v8_value_InstanceOf, ZEND_ACC_PUBLIC) +// PHP_ME(Value, __construct, arginfo_value___construct, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) + + PHP_ME(Value, getIsolate, arginfo_value_getIsolate, ZEND_ACC_PUBLIC) + + PHP_ME(Value, isUndefined, arginfo_value_isUndefined, ZEND_ACC_PUBLIC) + PHP_ME(Value, isNull, arginfo_value_isNull, ZEND_ACC_PUBLIC) + PHP_ME(Value, isNullOrUndefined, arginfo_value_isNullOrUndefined, ZEND_ACC_PUBLIC) + PHP_ME(Value, isTrue, arginfo_value_isTrue, ZEND_ACC_PUBLIC) + PHP_ME(Value, isFalse, arginfo_value_isFalse, ZEND_ACC_PUBLIC) + PHP_ME(Value, isName, arginfo_value_isName, ZEND_ACC_PUBLIC) + PHP_ME(Value, isString, arginfo_value_isString, ZEND_ACC_PUBLIC) + PHP_ME(Value, isSymbol, arginfo_value_isSymbol, ZEND_ACC_PUBLIC) + PHP_ME(Value, isFunction, arginfo_value_isFunction, ZEND_ACC_PUBLIC) + PHP_ME(Value, isArray, arginfo_value_isArray, ZEND_ACC_PUBLIC) + PHP_ME(Value, isObject, arginfo_value_isObject, ZEND_ACC_PUBLIC) + PHP_ME(Value, isBoolean, arginfo_value_isBoolean, ZEND_ACC_PUBLIC) + PHP_ME(Value, isNumber, arginfo_value_isNumber, ZEND_ACC_PUBLIC) + PHP_ME(Value, isInt32, arginfo_value_isInt32, ZEND_ACC_PUBLIC) + PHP_ME(Value, isUint32, arginfo_value_isUint32, ZEND_ACC_PUBLIC) + PHP_ME(Value, isDate, arginfo_value_isDate, ZEND_ACC_PUBLIC) + PHP_ME(Value, isArgumentsObject, arginfo_value_isArgumentsObject, ZEND_ACC_PUBLIC) + PHP_ME(Value, isBooleanObject, arginfo_value_isBooleanObject, ZEND_ACC_PUBLIC) + PHP_ME(Value, isNumberObject, arginfo_value_isNumberObject, ZEND_ACC_PUBLIC) + PHP_ME(Value, isStringObject, arginfo_value_isStringObject, ZEND_ACC_PUBLIC) + PHP_ME(Value, isSymbolObject, arginfo_value_isSymbolObject, ZEND_ACC_PUBLIC) + PHP_ME(Value, isNativeError, arginfo_value_isNativeError, ZEND_ACC_PUBLIC) + PHP_ME(Value, isRegExp, arginfo_value_isRegExp, ZEND_ACC_PUBLIC) + PHP_ME(Value, isAsyncFunction, arginfo_value_isAsyncFunction, ZEND_ACC_PUBLIC) + PHP_ME(Value, isGeneratorFunction, arginfo_value_isGeneratorFunction, ZEND_ACC_PUBLIC) + PHP_ME(Value, isGeneratorObject, arginfo_value_isGeneratorObject, ZEND_ACC_PUBLIC) + PHP_ME(Value, isPromise, arginfo_value_isPromise, ZEND_ACC_PUBLIC) + PHP_ME(Value, isMap, arginfo_value_isMap, ZEND_ACC_PUBLIC) + PHP_ME(Value, isSet, arginfo_value_isSet, ZEND_ACC_PUBLIC) + PHP_ME(Value, isMapIterator, arginfo_value_isMapIterator, ZEND_ACC_PUBLIC) + PHP_ME(Value, isSetIterator, arginfo_value_isSetIterator, ZEND_ACC_PUBLIC) + PHP_ME(Value, isWeakMap, arginfo_value_isWeakMap, ZEND_ACC_PUBLIC) + PHP_ME(Value, isWeakSet, arginfo_value_isWeakSet, ZEND_ACC_PUBLIC) + PHP_ME(Value, isArrayBuffer, arginfo_value_isArrayBuffer, ZEND_ACC_PUBLIC) + PHP_ME(Value, isArrayBufferView, arginfo_value_isArrayBufferView, ZEND_ACC_PUBLIC) + PHP_ME(Value, isTypedArray, arginfo_value_isTypedArray, ZEND_ACC_PUBLIC) + PHP_ME(Value, isUint8Array, arginfo_value_isUint8Array, ZEND_ACC_PUBLIC) + PHP_ME(Value, isUint8ClampedArray, arginfo_value_isUint8ClampedArray, ZEND_ACC_PUBLIC) + PHP_ME(Value, isInt8Array, arginfo_value_isInt8Array, ZEND_ACC_PUBLIC) + PHP_ME(Value, isUint16Array, arginfo_value_isUint16Array, ZEND_ACC_PUBLIC) + PHP_ME(Value, isInt16Array, arginfo_value_isInt16Array, ZEND_ACC_PUBLIC) + PHP_ME(Value, isUint32Array, arginfo_value_isUint32Array, ZEND_ACC_PUBLIC) + PHP_ME(Value, isInt32Array, arginfo_value_isInt32Array, ZEND_ACC_PUBLIC) + PHP_ME(Value, isFloat32Array, arginfo_value_isFloat32Array, ZEND_ACC_PUBLIC) + PHP_ME(Value, isFloat64Array, arginfo_value_isFloat64Array, ZEND_ACC_PUBLIC) + PHP_ME(Value, isDataView, arginfo_value_isDataView, ZEND_ACC_PUBLIC) + PHP_ME(Value, isSharedArrayBuffer, arginfo_value_isSharedArrayBuffer, ZEND_ACC_PUBLIC) + PHP_ME(Value, isProxy, arginfo_value_isProxy, ZEND_ACC_PUBLIC) + //PHP_ME(Value, isWebAssemblyCompiledModule, arginfo_value_isWebAssemblyCompiledModule, ZEND_ACC_PUBLIC) // Experimental + + PHP_ME(Value, toBoolean, arginfo_value_toBoolean, ZEND_ACC_PUBLIC) + PHP_ME(Value, toNumber, arginfo_value_toNumber, ZEND_ACC_PUBLIC) + PHP_ME(Value, toString, arginfo_value_toString, ZEND_ACC_PUBLIC) + PHP_ME(Value, toDetailString, arginfo_value_toDetailString, ZEND_ACC_PUBLIC) + PHP_ME(Value, toObject, arginfo_value_toObject, ZEND_ACC_PUBLIC) + PHP_ME(Value, toInteger, arginfo_value_toInteger, ZEND_ACC_PUBLIC) + PHP_ME(Value, toUint32, arginfo_value_toUint32, ZEND_ACC_PUBLIC) + PHP_ME(Value, toInt32, arginfo_value_toInt32, ZEND_ACC_PUBLIC) + PHP_ME(Value, toArrayIndex, arginfo_value_toArrayIndex, ZEND_ACC_PUBLIC) + + PHP_ME(Value, booleanValue, arginfo_value_booleanValue, ZEND_ACC_PUBLIC) + PHP_ME(Value, numberValue, arginfo_value_numberValue, ZEND_ACC_PUBLIC) + PHP_ME(Value, integerValue, arginfo_value_integerValue, ZEND_ACC_PUBLIC) + PHP_ME(Value, int32Value, arginfo_value_int32Value, ZEND_ACC_PUBLIC) + PHP_ME(Value, uint32Value, arginfo_value_uint32Value, ZEND_ACC_PUBLIC) + + PHP_ME(Value, equals, arginfo_value_equals, ZEND_ACC_PUBLIC) + PHP_ME(Value, strictEquals, arginfo_value_strictEquals, ZEND_ACC_PUBLIC) + PHP_ME(Value, sameValue, arginfo_value_sameValue, ZEND_ACC_PUBLIC) + PHP_ME(Value, typeOf, arginfo_value_typeOf, ZEND_ACC_PUBLIC) + PHP_ME(Value, instanceOf, arginfo_value_instanceOf, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/stubs/src/AdjustableExternalMemoryInterface.php b/stubs/src/AdjustableExternalMemoryInterface.php index 48dafaa..6bff9c4 100644 --- a/stubs/src/AdjustableExternalMemoryInterface.php +++ b/stubs/src/AdjustableExternalMemoryInterface.php @@ -19,7 +19,6 @@ interface AdjustableExternalMemoryInterface { /** - * * Adjusts the amount of registered external memory. Used to give V8 an * indication of the amount of externally allocated memory that is kept alive * by JavaScript object. V8 uses this to decide when to perform global @@ -44,12 +43,12 @@ interface AdjustableExternalMemoryInterface * * NOTE: returned adjusted value can't be less then zero. */ - public function AdjustExternalAllocatedMemory(int $change_in_bytes): int; + public function adjustExternalAllocatedMemory(int $change_in_bytes): int; /** * Get external allocated memory hint value. * * @return int */ - public function GetExternalAllocatedMemory(): int; + public function getExternalAllocatedMemory(): int; } diff --git a/stubs/src/ArrayObject.php b/stubs/src/ArrayObject.php index 7a55de6..625ccd5 100644 --- a/stubs/src/ArrayObject.php +++ b/stubs/src/ArrayObject.php @@ -35,7 +35,7 @@ public function __construct(Context $context, int $length = 0) /** * @return int */ - public function Length(): int + public function length(): int { } } diff --git a/stubs/src/BooleanObject.php b/stubs/src/BooleanObject.php index 0dc135c..68ae94e 100644 --- a/stubs/src/BooleanObject.php +++ b/stubs/src/BooleanObject.php @@ -32,7 +32,7 @@ public function __construct(Context $context, bool $value) /** * @return bool */ - public function ValueOf(): bool + public function valueOf(): bool { } } diff --git a/stubs/src/BooleanValue.php b/stubs/src/BooleanValue.php index 7d54fd7..8309004 100644 --- a/stubs/src/BooleanValue.php +++ b/stubs/src/BooleanValue.php @@ -32,7 +32,7 @@ public function __construct(Isolate $isolate, bool $value) /** * @return bool */ - public function Value(): bool + public function value(): bool { } } diff --git a/stubs/src/CallbackInfo.php b/stubs/src/CallbackInfo.php index bae2515..d42839d 100644 --- a/stubs/src/CallbackInfo.php +++ b/stubs/src/CallbackInfo.php @@ -20,14 +20,14 @@ class CallbackInfo /** * @return \V8\Isolate */ - public function GetIsolate(): Isolate + public function getIsolate(): Isolate { } /** * @return \V8\Context */ - public function GetContext(): Context + public function getContext(): Context { } @@ -36,7 +36,7 @@ public function GetContext(): Context * * @return \V8\ObjectValue */ - public function This(): ObjectValue + public function this(): ObjectValue { } @@ -52,7 +52,7 @@ public function This(): ObjectValue * * @return \V8\ObjectValue */ - public function Holder(): ObjectValue + public function holder(): ObjectValue { } @@ -61,7 +61,7 @@ public function Holder(): ObjectValue * * @return \V8\ReturnValue */ - public function GetReturnValue(): ReturnValue + public function getReturnValue(): ReturnValue { } } diff --git a/stubs/src/Context.php b/stubs/src/Context.php index 8d9796d..90b3bde 100644 --- a/stubs/src/Context.php +++ b/stubs/src/Context.php @@ -48,14 +48,16 @@ class Context * @internal param array|null $extensions Currently unused as there are not extensions support */ public function __construct( - Isolate $isolate, ObjectTemplate $global_template = null, ObjectValue $global_object = null + Isolate $isolate, + ObjectTemplate $global_template = null, + ObjectValue $global_object = null ) { } /** * @return \V8\Isolate */ - public function GetIsolate(): Isolate + public function getIsolate(): Isolate { return $this->isolate; } @@ -74,7 +76,7 @@ public function GetIsolate(): Isolate * * @return \V8\ObjectValue */ - public function GlobalObject(): ObjectValue + public function globalObject(): ObjectValue { } @@ -83,7 +85,7 @@ public function GlobalObject(): ObjectValue * Detaches the global object from its context before * the global object can be reused to create a new context. */ - public function DetachGlobal() + public function detachGlobal() { } @@ -93,14 +95,14 @@ public function DetachGlobal() * * @param \V8\Value $token */ - public function SetSecurityToken(Value $token) + public function setSecurityToken(Value $token) { } /** * Restores the security token to the default value. */ - public function UseDefaultSecurityToken() + public function useDefaultSecurityToken() { } @@ -109,7 +111,7 @@ public function UseDefaultSecurityToken() * * @return \V8\Value */ - public function GetSecurityToken(): Value + public function getSecurityToken(): Value { } @@ -128,7 +130,7 @@ public function GetSecurityToken(): Value * * @param bool $allow */ - public function AllowCodeGenerationFromStrings(bool $allow) + public function allowCodeGenerationFromStrings(bool $allow) { } @@ -138,7 +140,7 @@ public function AllowCodeGenerationFromStrings(bool $allow) * * @return bool */ - public function IsCodeGenerationFromStringsAllowed(): bool + public function isCodeGenerationFromStringsAllowed(): bool { } @@ -149,7 +151,7 @@ public function IsCodeGenerationFromStringsAllowed(): bool * * @param StringValue $message */ - public function SetErrorMessageForCodeGenerationFromStrings(StringValue $message) + public function setErrorMessageForCodeGenerationFromStrings(StringValue $message) { } } diff --git a/stubs/src/DateObject.php b/stubs/src/DateObject.php index 60d3624..51b58f7 100644 --- a/stubs/src/DateObject.php +++ b/stubs/src/DateObject.php @@ -33,7 +33,7 @@ public function __construct(Context $context, double $value) /** * @return double */ - public function ValueOf(): double + public function valueOf(): double { } @@ -51,7 +51,7 @@ public function ValueOf(): double * * @param \V8\Isolate $isolate */ - public static function DateTimeConfigurationChangeNotification(Isolate $isolate) + public static function dateTimeConfigurationChangeNotification(Isolate $isolate) { } } diff --git a/stubs/src/Exception.php b/stubs/src/Exception.php index 6ff118e..6c27e9c 100644 --- a/stubs/src/Exception.php +++ b/stubs/src/Exception.php @@ -28,7 +28,7 @@ class Exception * * @return \V8\ObjectValue */ - public static function RangeError(Context $context, StringValue $message): ObjectValue + public static function rangeError(Context $context, StringValue $message): ObjectValue { } @@ -38,7 +38,7 @@ public static function RangeError(Context $context, StringValue $message): Objec * * @return \V8\ObjectValue */ - public static function ReferenceError(Context $context, StringValue $message): ObjectValue + public static function referenceError(Context $context, StringValue $message): ObjectValue { } @@ -48,7 +48,7 @@ public static function ReferenceError(Context $context, StringValue $message): O * * @return \V8\ObjectValue */ - public static function SyntaxError(Context $context, StringValue $message): ObjectValue + public static function syntaxError(Context $context, StringValue $message): ObjectValue { } @@ -58,7 +58,7 @@ public static function SyntaxError(Context $context, StringValue $message): Obje * * @return \V8\ObjectValue */ - public static function TypeError(Context $context, StringValue $message): ObjectValue + public static function typeError(Context $context, StringValue $message): ObjectValue { } @@ -68,7 +68,7 @@ public static function TypeError(Context $context, StringValue $message): Object * * @return ObjectValue */ - public static function Error(Context $context, StringValue $message): ObjectValue + public static function error(Context $context, StringValue $message): ObjectValue { } @@ -82,7 +82,7 @@ public static function Error(Context $context, StringValue $message): ObjectValu * * @return Message */ - static function CreateMessage(Context $context, Value $exception): Message + static function createMessage(Context $context, Value $exception): Message { } @@ -95,7 +95,7 @@ static function CreateMessage(Context $context, Value $exception): Message * * @return null|StackTrace */ - public static function GetStackTrace(Context $context, Value $exception) + public static function getStackTrace(Context $context, Value $exception) { } } diff --git a/stubs/src/Exceptions/TryCatchException.php b/stubs/src/Exceptions/TryCatchException.php index f5a01ac..b06593e 100644 --- a/stubs/src/Exceptions/TryCatchException.php +++ b/stubs/src/Exceptions/TryCatchException.php @@ -45,7 +45,7 @@ public function __construct(Isolate $isolate, Context $context, TryCatch $try_ca /** * @return Isolate */ - public function GetIsolate(): Isolate + public function getIsolate(): Isolate { return $this->isolate; } @@ -53,7 +53,7 @@ public function GetIsolate(): Isolate /** * @return Context */ - public function GetContext(): Context + public function getContext(): Context { return $this->context; } @@ -61,7 +61,7 @@ public function GetContext(): Context /** * @return TryCatch */ - public function GetTryCatch(): TryCatch + public function getTryCatch(): TryCatch { return $this->try_catch; } diff --git a/stubs/src/FunctionCallbackInfo.php b/stubs/src/FunctionCallbackInfo.php index c3ce8f4..616ab3b 100644 --- a/stubs/src/FunctionCallbackInfo.php +++ b/stubs/src/FunctionCallbackInfo.php @@ -27,7 +27,7 @@ class FunctionCallbackInfo extends CallbackInfo /** * @return int */ - public function Length(): int + public function length(): int { } @@ -36,7 +36,7 @@ public function Length(): int * * @return Value[] | StringValue[] | SymbolValue[] | NumberValue[] | ObjectValue[] | ArrayObject[] | FunctionObject[] | StringObject[] | SymbolObject[] */ - public function Arguments(): array + public function arguments(): array { } @@ -45,7 +45,7 @@ public function Arguments(): array * * @return Value */ - public function NewTarget(): Value + public function newTarget(): Value { } @@ -54,7 +54,7 @@ public function NewTarget(): Value * * @return bool */ - public function IsConstructCall(): bool + public function isConstructCall(): bool { } } diff --git a/stubs/src/FunctionObject.php b/stubs/src/FunctionObject.php index fbe5b07..3444809 100644 --- a/stubs/src/FunctionObject.php +++ b/stubs/src/FunctionObject.php @@ -41,7 +41,7 @@ public function __construct(Context $context, callable $callback, int $length = * * @return \V8\ObjectValue */ - public function NewInstance(Context $context, array $arguments = []): ObjectValue + public function newInstance(Context $context, array $arguments = []): ObjectValue { } @@ -52,21 +52,21 @@ public function NewInstance(Context $context, array $arguments = []): ObjectValu * * @return \V8\Value */ - public function Call(Context $context, Value $recv, array $arguments = []): Value + public function call(Context $context, Value $recv, array $arguments = []): Value { } /** * @param StringValue $name */ - public function SetName(StringValue $name) + public function setName(StringValue $name) { } /** * @return \V8\Value | StringValue */ - public function GetName(): Value + public function getName(): Value { } @@ -78,7 +78,7 @@ public function GetName(): Value * * @return \V8\Value | StringValue */ - public function GetInferredName(): Value + public function getInferredName(): Value { } @@ -88,7 +88,7 @@ public function GetInferredName(): Value * * @return \V8\Value | StringValue */ - public function GetDisplayName(): Value + public function getDisplayName(): Value { } @@ -100,7 +100,7 @@ public function GetDisplayName(): Value * * @return int | null */ - public function GetScriptLineNumber() + public function getScriptLineNumber() { } @@ -111,7 +111,7 @@ public function GetScriptLineNumber() * * @return int | null */ - public function GetScriptColumnNumber() + public function getScriptColumnNumber() { } @@ -127,14 +127,14 @@ public function GetScriptColumnNumber() * * @return Value */ - public function GetBoundFunction(): Value + public function getBoundFunction(): Value { } /** * @return ScriptOrigin */ - public function GetScriptOrigin(): ScriptOrigin + public function getScriptOrigin(): ScriptOrigin { } } diff --git a/stubs/src/FunctionTemplate.php b/stubs/src/FunctionTemplate.php index 025d493..39983ad 100644 --- a/stubs/src/FunctionTemplate.php +++ b/stubs/src/FunctionTemplate.php @@ -141,7 +141,7 @@ public function __construct( * * @return FunctionObject */ - public function GetFunction(Context $context): FunctionObject + public function getFunction(Context $context): FunctionObject { } @@ -152,12 +152,12 @@ public function GetFunction(Context $context): FunctionObject * * @param callable $callback */ - public function SetCallHandler(callable $callback) + public function setCallHandler(callable $callback) { } /** Set the predefined length property for the FunctionTemplate. */ - public function SetLength(int $length) + public function setLength(int $length) { } @@ -166,7 +166,7 @@ public function SetLength(int $length) * * @return \V8\ObjectTemplate */ - public function InstanceTemplate(): ObjectTemplate + public function instanceTemplate(): ObjectTemplate { } @@ -175,7 +175,7 @@ public function InstanceTemplate(): ObjectTemplate * * @param FunctionTemplate $parent */ - public function Inherit(FunctionTemplate $parent) + public function inherit(FunctionTemplate $parent) { } @@ -185,7 +185,7 @@ public function Inherit(FunctionTemplate $parent) * * @return \V8\ObjectTemplate */ - public function PrototypeTemplate(): ObjectTemplate + public function prototypeTemplate(): ObjectTemplate { } @@ -196,7 +196,7 @@ public function PrototypeTemplate(): ObjectTemplate * * @param StringValue $name */ - public function SetClassName(StringValue $name) + public function setClassName(StringValue $name) { } @@ -219,7 +219,7 @@ public function SetClassName(StringValue $name) * function template. By default, instances of a function template * are not ignored. */ - public function SetHiddenPrototype($value) + public function setHiddenPrototype($value) { } @@ -227,7 +227,7 @@ public function SetHiddenPrototype($value) * Sets the ReadOnly flag in the attributes of the 'prototype' property * of functions created from this FunctionTemplate to true. */ - public function ReadOnlyPrototype() + public function readOnlyPrototype() { } @@ -235,7 +235,7 @@ public function ReadOnlyPrototype() * Removes the prototype property from functions created from this * FunctionTemplate. */ - public function RemovePrototype() + public function removePrototype() { } @@ -247,21 +247,21 @@ public function RemovePrototype() * * @return bool */ - public function HasInstance(Value $object): bool + public function hasInstance(Value $object): bool { } /** * {@inheritdoc} */ - public function AdjustExternalAllocatedMemory(int $change_in_bytes): int + public function adjustExternalAllocatedMemory(int $change_in_bytes): int { } /** * {@inheritdoc} */ - public function GetExternalAllocatedMemory(): int + public function getExternalAllocatedMemory(): int { } } diff --git a/stubs/src/Int32Value.php b/stubs/src/Int32Value.php index 28ce204..693a72e 100644 --- a/stubs/src/Int32Value.php +++ b/stubs/src/Int32Value.php @@ -32,7 +32,7 @@ public function __construct(Isolate $isolate, int $value) /** * @return int int32 value */ - public function Value(): int + public function value(): int { } } diff --git a/stubs/src/IntegerValue.php b/stubs/src/IntegerValue.php index b4d61d8..fdd0e24 100644 --- a/stubs/src/IntegerValue.php +++ b/stubs/src/IntegerValue.php @@ -32,7 +32,7 @@ public function __construct(Isolate $isolate, int $value) /** * @return int int64 value */ - public function Value(): int + public function value(): int { } } diff --git a/stubs/src/Isolate.php b/stubs/src/Isolate.php index 3d0cbb1..2433a38 100644 --- a/stubs/src/Isolate.php +++ b/stubs/src/Isolate.php @@ -25,27 +25,27 @@ public function __construct(StartupData $snapshot = null) { } - public function SetMemoryLimit(int $memory_limit_in_bytes) + public function setMemoryLimit(int $memory_limit_in_bytes) { } - public function GetMemoryLimit(): int + public function getMemoryLimit(): int { } - public function IsMemoryLimitHit(): bool + public function isMemoryLimitHit(): bool { } - public function SetTimeLimit(float $time_limit_in_seconds) + public function setTimeLimit(float $time_limit_in_seconds) { } - public function GetTimeLimit(): float + public function getTimeLimit(): float { } - public function IsTimeLimitHit(): bool + public function isTimeLimitHit(): bool { } @@ -54,7 +54,7 @@ public function IsTimeLimitHit(): bool * * @return HeapStatistics */ - public function GetHeapStatistics(): HeapStatistics + public function getHeapStatistics(): HeapStatistics { } @@ -63,7 +63,7 @@ public function GetHeapStatistics(): HeapStatistics * * @return bool */ - public function InContext(): bool + public function inContext(): bool { } @@ -72,7 +72,7 @@ public function InContext(): bool * * @return \V8\Context */ - public function GetEnteredContext(): Context + public function getEnteredContext(): Context { } @@ -93,7 +93,7 @@ public function GetEnteredContext(): Context * @throws ValueException When trying to associate external exception with non-object value * @throws ValueException When another external exception is already associated with a given value */ - public function ThrowException(Context $context, Value $value, Throwable $e = null) + public function throwException(Context $context, Value $value, Throwable $e = null) { } @@ -104,7 +104,7 @@ public function ThrowException(Context $context, Value $value, Throwable $e = nu * This method can be used by any thread even if that thread has not * acquired the V8 lock with a Locker object. */ - public function TerminateExecution() + public function terminateExecution() { } @@ -118,7 +118,7 @@ public function TerminateExecution() * * @return bool */ - public function IsExecutionTerminating(): bool + public function isExecutionTerminating(): bool { } @@ -136,7 +136,7 @@ public function IsExecutionTerminating(): bool * This method can be used by any thread even if that thread has not * acquired the V8 lock with a Locker object. */ - public function CancelTerminateExecution() + public function cancelTerminateExecution() { } @@ -158,7 +158,7 @@ public function CancelTerminateExecution() * * @return bool */ - public function IdleNotificationDeadline($deadline_in_seconds): bool + public function idleNotificationDeadline($deadline_in_seconds): bool { } @@ -166,7 +166,7 @@ public function IdleNotificationDeadline($deadline_in_seconds): bool * Optional notification that the system is running low on memory. * V8 uses these notifications to attempt to free memory. */ - public function LowMemoryNotification() + public function lowMemoryNotification() { } @@ -176,7 +176,7 @@ public function LowMemoryNotification() * * @return bool */ - public function IsDead(): bool + public function isDead(): bool { } @@ -186,7 +186,7 @@ public function IsDead(): bool * * @return bool */ - public function IsInUse(): bool + public function isInUse(): bool { } @@ -197,7 +197,7 @@ public function IsInUse(): bool * @param bool $capture * @param int $frame_limit */ - public function SetCaptureStackTraceForUncaughtExceptions(bool $capture, int $frame_limit = 10) + public function setCaptureStackTraceForUncaughtExceptions(bool $capture, int $frame_limit = 10) { } } diff --git a/stubs/src/MapObject.php b/stubs/src/MapObject.php index f29a199..0df265f 100644 --- a/stubs/src/MapObject.php +++ b/stubs/src/MapObject.php @@ -21,11 +21,11 @@ */ class MapObject extends ObjectValue { - public function Size(): float + public function size(): float { } - public function Clear() + public function clear() { } @@ -35,7 +35,7 @@ public function Clear() * * @return Value */ - public function Get(Context $context, Value $key): Value + public function get(Context $context, Value $key): Value { } @@ -46,7 +46,7 @@ public function Get(Context $context, Value $key): Value * * @return MapObject */ - public function Set(Context $context, Value $key, Value $value): MapObject + public function set(Context $context, Value $key, Value $value): MapObject { } @@ -56,7 +56,7 @@ public function Set(Context $context, Value $key, Value $value): MapObject * * @return bool */ - public function Has(Context $context, Value $key): bool + public function has(Context $context, Value $key): bool { } @@ -66,7 +66,7 @@ public function Has(Context $context, Value $key): bool * * @return bool */ - public function Delete(Context $context, Value $key): bool + public function delete(Context $context, Value $key): bool { } @@ -76,7 +76,7 @@ public function Delete(Context $context, Value $key): bool * * @return ArrayObject */ - public function AsArray(): ArrayObject + public function asArray(): ArrayObject { } diff --git a/stubs/src/Message.php b/stubs/src/Message.php index d4024c0..2cd2c51 100644 --- a/stubs/src/Message.php +++ b/stubs/src/Message.php @@ -119,7 +119,7 @@ public function __construct( /** * @return string */ - public function Get(): string + public function get(): string { } @@ -128,7 +128,7 @@ public function Get(): string * * @return string */ - public function GetSourceLine(): string + public function getSourceLine(): string { } @@ -138,7 +138,7 @@ public function GetSourceLine(): string * * @return ScriptOrigin */ - public function GetScriptOrigin(): ScriptOrigin + public function getScriptOrigin(): ScriptOrigin { } @@ -148,7 +148,7 @@ public function GetScriptOrigin(): ScriptOrigin * * @return string */ - public function GetScriptResourceName(): string + public function getScriptResourceName(): string { } @@ -159,7 +159,7 @@ public function GetScriptResourceName(): string * * @return StackTrace */ - public function GetStackTrace(): StackTrace + public function getStackTrace(): StackTrace { } @@ -168,7 +168,7 @@ public function GetStackTrace(): StackTrace * * @return int */ - public function GetLineNumber(): int + public function getLineNumber(): int { } @@ -178,7 +178,7 @@ public function GetLineNumber(): int * * @return int */ - public function GetStartPosition(): int + public function getStartPosition(): int { } @@ -188,7 +188,7 @@ public function GetStartPosition(): int * * @return int */ - public function GetEndPosition(): int + public function getEndPosition(): int { } @@ -198,7 +198,7 @@ public function GetEndPosition(): int * * @return int */ - public function GetStartColumn(): int + public function getStartColumn(): int { } @@ -208,7 +208,7 @@ public function GetStartColumn(): int * * @return int */ - public function GetEndColumn(): int + public function getEndColumn(): int { } @@ -218,14 +218,14 @@ public function GetEndColumn(): int * * @return bool */ - public function IsSharedCrossOrigin(): bool + public function isSharedCrossOrigin(): bool { } /** * @return bool */ - public function IsOpaque(): bool + public function isOpaque(): bool { } } diff --git a/stubs/src/NameValue.php b/stubs/src/NameValue.php index 00024d7..f1449be 100644 --- a/stubs/src/NameValue.php +++ b/stubs/src/NameValue.php @@ -28,7 +28,7 @@ abstract class NameValue extends PrimitiveValue * The return value will never be 0. Also, it is not guaranteed to be * unique. */ - public function GetIdentityHash(): int + public function getIdentityHash(): int { } } diff --git a/stubs/src/NullValue.php b/stubs/src/NullValue.php index 5ce332d..8bc84c5 100644 --- a/stubs/src/NullValue.php +++ b/stubs/src/NullValue.php @@ -25,7 +25,7 @@ public function __construct(Isolate $isolate) /** * @return null */ - public function Value() + public function value() { } } diff --git a/stubs/src/NumberObject.php b/stubs/src/NumberObject.php index eea0c12..c1bc84d 100644 --- a/stubs/src/NumberObject.php +++ b/stubs/src/NumberObject.php @@ -33,7 +33,7 @@ public function __construct(Context $context, $value) /** * @return double */ - public function ValueOf() + public function valueOf() { } } diff --git a/stubs/src/NumberValue.php b/stubs/src/NumberValue.php index 82a187e..d01b117 100644 --- a/stubs/src/NumberValue.php +++ b/stubs/src/NumberValue.php @@ -31,7 +31,7 @@ public function __construct(Isolate $isolate, float $value) /** * @return float */ - public function Value() + public function value() { } } diff --git a/stubs/src/ObjectTemplate.php b/stubs/src/ObjectTemplate.php index 7fe8c79..1da6ae5 100644 --- a/stubs/src/ObjectTemplate.php +++ b/stubs/src/ObjectTemplate.php @@ -35,7 +35,7 @@ public function __construct(Isolate $isolate, FunctionTemplate $constructor = nu * * @return \V8\ObjectValue */ - public function NewInstance(Context $context): ObjectValue + public function newInstance(Context $context): ObjectValue { } @@ -67,7 +67,7 @@ public function NewInstance(Context $context): ObjectValue * thrown and no callback is invoked. */ - public function SetAccessor( + public function setAccessor( NameValue $name, callable $getter, callable $setter, @@ -89,7 +89,7 @@ public function SetAccessor( * * @param \v8\NamedPropertyHandlerConfiguration The NamedPropertyHandlerConfiguration that defines the callbacks to invoke when accessing a property. */ - public function SetHandlerForNamedProperty(NamedPropertyHandlerConfiguration $configuration) + public function setHandlerForNamedProperty(NamedPropertyHandlerConfiguration $configuration) { } @@ -104,7 +104,7 @@ public function SetHandlerForNamedProperty(NamedPropertyHandlerConfiguration $co * * @param \V8\IndexedPropertyHandlerConfiguration $configuration The IndexedPropertyHandlerConfiguration that defines the callbacks to invoke when accessing a property. */ - public function SetHandlerForIndexedProperty(IndexedPropertyHandlerConfiguration $configuration) + public function setHandlerForIndexedProperty(IndexedPropertyHandlerConfiguration $configuration) { } @@ -116,21 +116,21 @@ public function SetHandlerForIndexedProperty(IndexedPropertyHandlerConfiguration * * @param callable $callback */ - public function SetCallAsFunctionHandler(callable $callback) + public function setCallAsFunctionHandler(callable $callback) { } /** * {@inheritdoc} */ - public function AdjustExternalAllocatedMemory(int $change_in_bytes): int + public function adjustExternalAllocatedMemory(int $change_in_bytes): int { } /** * {@inheritdoc} */ - public function GetExternalAllocatedMemory(): int + public function getExternalAllocatedMemory(): int { } } diff --git a/stubs/src/ObjectValue.php b/stubs/src/ObjectValue.php index 5f79ae4..d88f46b 100644 --- a/stubs/src/ObjectValue.php +++ b/stubs/src/ObjectValue.php @@ -23,13 +23,13 @@ class ObjectValue extends Value implements AdjustableExternalMemoryInterface { public function __construct(Context $context) { - parent::__construct($context->GetIsolate()); + parent::__construct($context->getIsolate()); } /** * @return \V8\Context */ - public function GetContext() + public function getContext() { } @@ -40,7 +40,7 @@ public function GetContext() * * @return bool */ - public function Set(Context $context, Value $key, Value $value): bool + public function set(Context $context, Value $key, Value $value): bool { } @@ -58,7 +58,7 @@ public function Set(Context $context, Value $key, Value $value): bool * * @return bool */ - public function CreateDataProperty(Context $context, NameValue $key, Value $value): bool + public function createDataProperty(Context $context, NameValue $key, Value $value): bool { } @@ -74,7 +74,7 @@ public function CreateDataProperty(Context $context, NameValue $key, Value $valu * * @return bool */ - public function DefineOwnProperty( + public function defineOwnProperty( Context $context, NameValue $key, Value $value, @@ -88,7 +88,7 @@ public function DefineOwnProperty( * * @return \V8\Value | \V8\ObjectValue | \V8\FunctionObject | ArrayObject | StringValue | NumberValue */ - public function Get(Context $context, Value $key): Value + public function get(Context $context, Value $key): Value { } @@ -102,7 +102,7 @@ public function Get(Context $context, Value $key): Value * * @return int */ - public function GetPropertyAttributes(Context $context, NameValue $key): int + public function getPropertyAttributes(Context $context, NameValue $key): int { } @@ -114,7 +114,7 @@ public function GetPropertyAttributes(Context $context, NameValue $key): int * * @return \V8\Value */ - public function GetOwnPropertyDescriptor(Context $context, NameValue $key): Value + public function getOwnPropertyDescriptor(Context $context, NameValue $key): Value { } @@ -124,7 +124,7 @@ public function GetOwnPropertyDescriptor(Context $context, NameValue $key): Valu * * @return bool */ - public function Has(Context $context, Value $key): bool + public function has(Context $context, Value $key): bool { } @@ -134,7 +134,7 @@ public function Has(Context $context, Value $key): bool * * @return bool */ - public function Delete(Context $context, Value $key): bool + public function delete(Context $context, Value $key): bool { } @@ -148,7 +148,7 @@ public function Delete(Context $context, Value $key): bool * * @return bool */ - public function SetAccessor( + public function setAccessor( Context $context, NameValue $name, callable $getter, @@ -165,7 +165,7 @@ public function SetAccessor( * @param int $attributes * @param int $settings */ - public function SetAccessorProperty( + public function setAccessorProperty( NameValue $name, FunctionObject $getter, FunctionObject $setter = null, @@ -186,7 +186,7 @@ public function SetAccessorProperty( * * @return bool */ - public function SetNativeDataProperty( + public function setNativeDataProperty( Context $context, NameValue $name, callable $getter, @@ -208,7 +208,7 @@ public function SetNativeDataProperty( * * @return ArrayObject */ - public function GetPropertyNames( + public function getPropertyNames( Context $context, int $mode = KeyCollectionMode::kOwnOnly, int $property_filter = PropertyFilter::ALL_PROPERTIES, @@ -226,7 +226,7 @@ public function GetPropertyNames( * * @return ArrayObject */ - public function GetOwnPropertyNames(Context $context, int $filter = PropertyFilter::ALL_PROPERTIES): ArrayObject + public function getOwnPropertyNames(Context $context, int $filter = PropertyFilter::ALL_PROPERTIES): ArrayObject { } @@ -237,7 +237,7 @@ public function GetOwnPropertyNames(Context $context, int $filter = PropertyFilt * * @return \V8\Value */ - public function GetPrototype(): Value + public function getPrototype(): Value { } @@ -251,7 +251,7 @@ public function GetPrototype(): Value * * @return bool */ - public function SetPrototype(Context $context, Value $prototype): bool + public function setPrototype(Context $context, Value $prototype): bool { } @@ -263,7 +263,7 @@ public function SetPrototype(Context $context, Value $prototype): bool * * @return Object */ - public function FindInstanceInPrototypeChain(FunctionTemplate $tmpl): Object + public function findInstanceInPrototypeChain(FunctionTemplate $tmpl): Object { } @@ -276,7 +276,7 @@ public function FindInstanceInPrototypeChain(FunctionTemplate $tmpl): Object * * @return StringValue */ - public function ObjectProtoToString(Context $context): StringValue + public function objectProtoToString(Context $context): StringValue { } @@ -285,7 +285,7 @@ public function ObjectProtoToString(Context $context): StringValue * * @return StringValue */ - public function GetConstructorName(): StringValue + public function getConstructorName(): StringValue { } @@ -297,7 +297,7 @@ public function GetConstructorName(): StringValue * * @return bool */ - public function SetIntegrityLevel(Context $context, int $level): bool + public function setIntegrityLevel(Context $context, int $level): bool { } @@ -307,7 +307,7 @@ public function SetIntegrityLevel(Context $context, int $level): bool * * @return bool */ - public function HasOwnProperty(Context $context, $key): bool + public function hasOwnProperty(Context $context, $key): bool { } @@ -317,7 +317,7 @@ public function HasOwnProperty(Context $context, $key): bool * * @return bool */ - public function HasRealNamedProperty(Context $context, $key): bool + public function hasRealNamedProperty(Context $context, $key): bool { } @@ -327,7 +327,7 @@ public function HasRealNamedProperty(Context $context, $key): bool * * @return bool */ - public function HasRealIndexedProperty(Context $context, $index): bool + public function hasRealIndexedProperty(Context $context, $index): bool { } @@ -337,7 +337,7 @@ public function HasRealIndexedProperty(Context $context, $index): bool * * @return bool */ - public function HasRealNamedCallbackProperty(Context $context, $key): bool + public function hasRealNamedCallbackProperty(Context $context, $key): bool { } @@ -350,7 +350,7 @@ public function HasRealNamedCallbackProperty(Context $context, $key): bool * * @return \V8\Value */ - public function GetRealNamedPropertyInPrototypeChain(Context $context, $key): Value + public function getRealNamedPropertyInPrototypeChain(Context $context, $key): Value { } @@ -364,7 +364,7 @@ public function GetRealNamedPropertyInPrototypeChain(Context $context, $key): Va * * @return int */ - public function GetRealNamedPropertyAttributesInPrototypeChain(Context $context, NameValue $key): int + public function getRealNamedPropertyAttributesInPrototypeChain(Context $context, NameValue $key): int { } @@ -378,7 +378,7 @@ public function GetRealNamedPropertyAttributesInPrototypeChain(Context $context, * * @return \V8\Value */ - public function GetRealNamedProperty(Context $context, $key): Value + public function getRealNamedProperty(Context $context, $key): Value { } @@ -392,7 +392,7 @@ public function GetRealNamedProperty(Context $context, $key): Value * * @return int */ - public function GetRealNamedPropertyAttributes(Context $context, NameValue $key): int + public function getRealNamedPropertyAttributes(Context $context, NameValue $key): int { } @@ -402,7 +402,7 @@ public function GetRealNamedPropertyAttributes(Context $context, NameValue $key) * * @return bool */ - public function HasNamedLookupInterceptor(): bool + public function hasNamedLookupInterceptor(): bool { } @@ -411,7 +411,7 @@ public function HasNamedLookupInterceptor(): bool * * @return bool */ - public function HasIndexedLookupInterceptor(): bool + public function hasIndexedLookupInterceptor(): bool { } @@ -424,7 +424,7 @@ public function HasIndexedLookupInterceptor(): bool * * @return int */ - public function GetIdentityHash(): int + public function getIdentityHash(): int { } @@ -434,7 +434,7 @@ public function GetIdentityHash(): int * * @return ObjectValue */ - public function Clone(): ObjectValue + public function clone(): ObjectValue { } @@ -445,7 +445,7 @@ public function Clone(): ObjectValue * * @return bool */ - public function IsCallable(): bool + public function isCallable(): bool { } @@ -454,7 +454,7 @@ public function IsCallable(): bool * * @return bool */ - public function IsConstructor(): bool + public function isConstructor(): bool { } @@ -468,7 +468,7 @@ public function IsConstructor(): bool * * @return \V8\Value */ - public function CallAsFunction(Context $context, Value $recv, array $arguments = []): Value + public function callAsFunction(Context $context, Value $recv, array $arguments = []): Value { } @@ -482,21 +482,21 @@ public function CallAsFunction(Context $context, Value $recv, array $arguments = * * @return \V8\Value */ - public function CallAsConstructor(Context $context, array $arguments = []): Value + public function callAsConstructor(Context $context, array $arguments = []): Value { } /** * {@inheritdoc} */ - public function AdjustExternalAllocatedMemory(int $change_in_bytes): int + public function adjustExternalAllocatedMemory(int $change_in_bytes): int { } /** * {@inheritdoc} */ - public function GetExternalAllocatedMemory(): int + public function getExternalAllocatedMemory(): int { } } diff --git a/stubs/src/PrimitiveValue.php b/stubs/src/PrimitiveValue.php index b4506bc..fd54c04 100644 --- a/stubs/src/PrimitiveValue.php +++ b/stubs/src/PrimitiveValue.php @@ -21,5 +21,5 @@ */ abstract class PrimitiveValue extends Value { - abstract public function Value(); + abstract public function value(); } diff --git a/stubs/src/PropertyCallbackInfo.php b/stubs/src/PropertyCallbackInfo.php index afb843d..837b38f 100644 --- a/stubs/src/PropertyCallbackInfo.php +++ b/stubs/src/PropertyCallbackInfo.php @@ -29,7 +29,7 @@ class PropertyCallbackInfo extends CallbackInfo * * @return bool */ - public function ShouldThrowOnError(): bool + public function shouldThrowOnError(): bool { } } diff --git a/stubs/src/RegExpObject.php b/stubs/src/RegExpObject.php index d2019c4..fe82a16 100644 --- a/stubs/src/RegExpObject.php +++ b/stubs/src/RegExpObject.php @@ -32,14 +32,14 @@ public function __construct(Context $context, StringValue $pattern, int $flags = /** * @return StringValue */ - public function GetSource(): StringValue + public function getSource(): StringValue { } /** * @return int */ - public function GetFlags(): int + public function getFlags(): int { } } diff --git a/stubs/src/ReturnValue.php b/stubs/src/ReturnValue.php index fb40ac0..47ec00c 100644 --- a/stubs/src/ReturnValue.php +++ b/stubs/src/ReturnValue.php @@ -18,77 +18,93 @@ class ReturnValue { + /** - * @param \V8\Value $value + * @return \V8\Isolate */ - public function Set(Value $value) + public function getIsolate(): Isolate { } /** - * Getter - * - * If the ReturnValue was not yet set, this will return the undefined value. - * - * @return Value | StringValue | NumberValue | ObjectValue | ArrayObject | FunctionObject + * @return \V8\Context */ - public function Get(): Value + public function getContext(): Context { } - public function SetNull() + /** + * Check whether return value is in current calling context and thus is usable + * + * @return bool + */ + public function inContext(): bool { } - public function SetUndefined() + /** + * @param \V8\Value $value + */ + public function set(Value $value) { } - public function SetEmptyString() + /** + * Getter + * + * If the ReturnValue was not yet set, this will return the undefined value. + * + * @return Value|StringValue|NumberValue|ObjectValue|ArrayObject|FunctionObject|DateObject|RegExpObject + */ + public function get(): Value { } /** - * @param bool $value + * Quick setter to set return value to null */ - public function SetBool(bool $value) + public function setNull() { } /** - * @param int $i + * Quick setter to set return value to undefined */ - public function SetInteger(int $i) + public function setUndefined() { } /** - * @param float $i + * Quick setter to set return value to an empty string */ - public function SetFloat(float $i) + public function setEmptyString() { } /** - * @return \V8\Isolate + * Quick setter to set return value to the provided boolean value + * + * @param bool $value */ - public function GetIsolate(): Isolate + public function setBool(bool $value) { } /** - * @return \V8\Context + * Quick setter to set return value to the provided integer value + * + * @param int $i */ - public function GetContext(): Context + public function setInteger(int $i) { } /** - * Check whether object is in current calling context and thus is usable + * Quick setter to set return value to the provided float value * - * @return bool + * @param float $i */ - public function InContext(): bool + public function setFloat(float $i) { } } diff --git a/stubs/src/Script.php b/stubs/src/Script.php index f1b7c5f..1c92786 100644 --- a/stubs/src/Script.php +++ b/stubs/src/Script.php @@ -34,14 +34,14 @@ public function __construct(Context $context, StringValue $source, ScriptOrigin /** * @return Isolate */ - public function GetIsolate(): Isolate + public function getIsolate(): Isolate { } /** * @return \V8\Context */ - public function GetContext(): Context + public function getContext(): Context { } @@ -52,7 +52,7 @@ public function GetContext(): Context * * @return BooleanValue | FunctionObject | NumberValue | ObjectValue | StringValue | Value */ - public function Run(Context $context): Value + public function run(Context $context): Value { } @@ -61,7 +61,7 @@ public function Run(Context $context): Value * * @return \V8\UnboundScript */ - public function GetUnboundScript(): UnboundScript + public function getUnboundScript(): UnboundScript { } } diff --git a/stubs/src/ScriptCompiler.php b/stubs/src/ScriptCompiler.php index 9be0151..2eefb68 100644 --- a/stubs/src/ScriptCompiler.php +++ b/stubs/src/ScriptCompiler.php @@ -36,7 +36,7 @@ private function __construct() * * @return int */ - public static function CachedDataVersionTag(): int + public static function cachedDataVersionTag(): int { } @@ -59,7 +59,7 @@ public static function CachedDataVersionTag(): int * * @return UnboundScript */ - public static function CompileUnboundScript(Context $context, Source $source, int $options = CompileOptions::kNoCompileOptions): UnboundScript + public static function compileUnboundScript(Context $context, Source $source, int $options = CompileOptions::kNoCompileOptions): UnboundScript { } @@ -80,7 +80,7 @@ public static function CompileUnboundScript(Context $context, Source $source, in * * @return Script */ - public static function Compile(Context $context, Source $source, int $options = CompileOptions::kNoCompileOptions): Script + public static function compile(Context $context, Source $source, int $options = CompileOptions::kNoCompileOptions): Script { } @@ -101,7 +101,7 @@ public static function Compile(Context $context, Source $source, int $options = * * @return FunctionObject */ - public static function CompileFunctionInContext(Context $context, Source $source, array $arguments = [], array $context_extensions = []): FunctionObject + public static function compileFunctionInContext(Context $context, Source $source, array $arguments = [], array $context_extensions = []): FunctionObject { } } diff --git a/stubs/src/ScriptCompiler/Source.php b/stubs/src/ScriptCompiler/Source.php index 054a5a4..742138f 100644 --- a/stubs/src/ScriptCompiler/Source.php +++ b/stubs/src/ScriptCompiler/Source.php @@ -36,17 +36,17 @@ public function __construct(StringValue $source_string, ScriptOrigin $origin = n $this->cached_data = $cached_data; } - public function GetSourceString(): StringValue + public function getSourceString(): StringValue { return $this->source_string; } - public function GetScriptOrigin(): ScriptOrigin + public function getScriptOrigin(): ScriptOrigin { return $this->origin; } - public function GetCachedData(): CachedData + public function getCachedData(): CachedData { return $this->cached_data; } diff --git a/stubs/src/ScriptOrigin.php b/stubs/src/ScriptOrigin.php index 149d50c..068159f 100644 --- a/stubs/src/ScriptOrigin.php +++ b/stubs/src/ScriptOrigin.php @@ -79,32 +79,32 @@ public function __construct( $this->source_map_url = $source_map_url; } - public function ResourceName(): string + public function resourceName(): string { return $this->resource_name; } - public function ResourceLineOffset(): int + public function resourceLineOffset(): int { return $this->resource_line_offset; } - public function ResourceColumnOffset(): int + public function resourceColumnOffset(): int { return $this->resource_column_offset; } - public function ScriptID(): int + public function scriptId(): int { return $this->script_id; } - public function SourceMapUrl(): string + public function sourceMapUrl(): string { return $this->source_map_url; } - public function Options(): ScriptOriginOptions + public function options(): ScriptOriginOptions { return $this->options; } diff --git a/stubs/src/ScriptOriginOptions.php b/stubs/src/ScriptOriginOptions.php index 7557990..a9306d4 100644 --- a/stubs/src/ScriptOriginOptions.php +++ b/stubs/src/ScriptOriginOptions.php @@ -59,7 +59,7 @@ public function __construct( /** * @return bool */ - public function IsSharedCrossOrigin(): bool + public function isSharedCrossOrigin(): bool { return $this->is_shared_cross_origin; } @@ -67,7 +67,7 @@ public function IsSharedCrossOrigin(): bool /** * @return bool */ - public function IsOpaque(): bool + public function isOpaque(): bool { return $this->is_opaque; } @@ -75,7 +75,7 @@ public function IsOpaque(): bool /** * @return bool */ - public function IsWasm(): bool + public function isWasm(): bool { return $this->is_wasm; } @@ -83,7 +83,7 @@ public function IsWasm(): bool /** * @return bool */ - public function IsModule(): bool + public function isModule(): bool { return $this->is_module; } diff --git a/stubs/src/SetObject.php b/stubs/src/SetObject.php index 80ca4a9..054c9b4 100644 --- a/stubs/src/SetObject.php +++ b/stubs/src/SetObject.php @@ -20,30 +20,32 @@ */ class SetObject extends ObjectValue { - public function Size(): float + public function size(): float { } - public function Clear() + public function clear() { } - public function Add(Context $context, Value $key): SetObject + public function add(Context $context, Value $key): SetObject { } - public function Has(Context $context, Value $key): bool + public function has(Context $context, Value $key): bool { } - public function Delete(Context $context, Value $key): bool + public function delete(Context $context, Value $key): bool { } /** * Returns an array of the keys in this Set. + * + * @return \V8\ArrayObject */ - public function AsArray(): ArrayObject + public function asArray(): ArrayObject { } } diff --git a/stubs/src/StackFrame.php b/stubs/src/StackFrame.php index 4789586..4134a74 100644 --- a/stubs/src/StackFrame.php +++ b/stubs/src/StackFrame.php @@ -91,7 +91,7 @@ public function __construct( * * @return int */ - public function GetLineNumber(): int + public function getLineNumber(): int { return $this->line_number; } @@ -105,7 +105,7 @@ public function GetLineNumber(): int * * @return int */ - public function GetColumn(): int + public function getColumn(): int { return $this->column; } @@ -118,7 +118,7 @@ public function GetColumn(): int * * @return int */ - public function GetScriptId(): int + public function getScriptId(): int { return $this->script_id; } @@ -129,7 +129,7 @@ public function GetScriptId(): int * * @return string */ - public function GetScriptName(): string + public function getScriptName(): string { return $this->script_name; } @@ -142,7 +142,7 @@ public function GetScriptName(): string * * @return string */ - public function GetScriptNameOrSourceURL(): string + public function getScriptNameOrSourceURL(): string { return $this->script_name_or_source_url; } @@ -152,7 +152,7 @@ public function GetScriptNameOrSourceURL(): string * * @return string */ - public function GetFunctionName(): string + public function getFunctionName(): string { return $this->function_name; } @@ -163,7 +163,7 @@ public function GetFunctionName(): string * * @return bool */ - public function IsEval(): bool + public function isEval(): bool { return $this->is_eval; } @@ -174,7 +174,7 @@ public function IsEval(): bool * * @return bool */ - public function IsConstructor(): bool + public function isConstructor(): bool { return $this->is_constructor; } diff --git a/stubs/src/StackTrace.php b/stubs/src/StackTrace.php index 7794235..414c344 100644 --- a/stubs/src/StackTrace.php +++ b/stubs/src/StackTrace.php @@ -48,7 +48,7 @@ public function __construct(array $frames) * * @return StackFrame[] */ - public function GetFrames(): array + public function getFrames(): array { return $this->frames; } @@ -62,7 +62,7 @@ public function GetFrames(): array * * @throws Exception When index is out of range */ - public function GetFrame(int $index): StackFrame + public function getFrame(int $index): StackFrame { if ($index < 0 || !isset($this->frames[$index])) { throw new Exception('Frame index is out of range'); @@ -76,7 +76,7 @@ public function GetFrame(int $index): StackFrame * * @return int */ - public function GetFrameCount(): int + public function getFrameCount(): int { return count($this->frames); } @@ -97,7 +97,7 @@ public function GetFrameCount(): int * * @return StackTrace */ - public static function CurrentStackTrace(Isolate $isolate, int $frame_limit): StackTrace + public static function currentStackTrace(Isolate $isolate, int $frame_limit): StackTrace { } } diff --git a/stubs/src/StartupData.php b/stubs/src/StartupData.php index b235e15..bff9d1d 100644 --- a/stubs/src/StartupData.php +++ b/stubs/src/StartupData.php @@ -25,11 +25,11 @@ public function __construct(string $blob) { } - public function GetData(): string + public function getData(): string { } - public function GetRawSize(): int + public function getRawSize(): int { } @@ -40,7 +40,7 @@ public function GetRawSize(): int * * @return StartupData */ - public static function CreateFromSource(string $source): StartupData + public static function createFromSource(string $source): StartupData { $blob = '/* convert source to blob*/'; diff --git a/stubs/src/StringObject.php b/stubs/src/StringObject.php index 0f97f2f..ae3abb3 100644 --- a/stubs/src/StringObject.php +++ b/stubs/src/StringObject.php @@ -33,7 +33,7 @@ public function __construct(Context $context, StringValue $value) /** * @return \V8\StringValue */ - public function ValueOf() + public function valueOf() { } } diff --git a/stubs/src/StringValue.php b/stubs/src/StringValue.php index 0f3ae23..54611e3 100644 --- a/stubs/src/StringValue.php +++ b/stubs/src/StringValue.php @@ -34,35 +34,35 @@ public function __construct(Isolate $isolate, $data = '') /** * @return string */ - public function Value(): string + public function value(): string { } /** * @return int */ - public function Length(): int + public function length(): int { } /** * @return int */ - public function Utf8Length(): int + public function utf8Length(): int { } /** * @return bool */ - public function IsOneByte(): bool + public function isOneByte(): bool { } /** * @return bool */ - public function ContainsOnlyOneByte():bool + public function containsOnlyOneByte():bool { } } diff --git a/stubs/src/SymbolObject.php b/stubs/src/SymbolObject.php index 1c5cc1f..93a4dc2 100644 --- a/stubs/src/SymbolObject.php +++ b/stubs/src/SymbolObject.php @@ -33,7 +33,7 @@ public function __construct(Context $context, SymbolValue $value) /** * @return SymbolValue */ - public function ValueOf(): SymbolValue + public function valueOf(): SymbolValue { } } diff --git a/stubs/src/SymbolValue.php b/stubs/src/SymbolValue.php index c9438c7..645f091 100644 --- a/stubs/src/SymbolValue.php +++ b/stubs/src/SymbolValue.php @@ -36,7 +36,7 @@ public function __construct(Isolate $isolate, StringValue $name = null) /** * @return string */ - public function Value(): string + public function value(): string { } @@ -45,7 +45,7 @@ public function Value(): string * * @return StringValue | UndefinedValue | Value */ - public function Name(): Value + public function name(): Value { } @@ -63,7 +63,7 @@ public function Name(): Value * * @return SymbolValue */ - public static function For (Context $context, StringValue $name): SymbolValue + public static function for(Context $context, StringValue $name): SymbolValue { } @@ -78,7 +78,7 @@ public static function For (Context $context, StringValue $name): SymbolValue * * @return SymbolValue */ - public static function ForApi(Context $context, StringValue $name): SymbolValue + public static function forApi(Context $context, StringValue $name): SymbolValue { } @@ -89,16 +89,16 @@ public static function ForApi(Context $context, StringValue $name): SymbolValue * * @return SymbolValue */ - public static function GetHasInstance(Isolate $isolate): SymbolValue + public static function getHasInstance(Isolate $isolate): SymbolValue { } /** * @param Isolate $isolate * - * @return SymbolValue + * @return \V8\SymbolValue */ - public static function GetIsConcatSpreadable(Isolate $isolate): SymbolValue + public static function getIsConcatSpreadable(Isolate $isolate): SymbolValue { } @@ -107,7 +107,7 @@ public static function GetIsConcatSpreadable(Isolate $isolate): SymbolValue * * @return SymbolValue */ - public static function GetIterator(Isolate $isolate): SymbolValue + public static function getIterator(Isolate $isolate): SymbolValue { } @@ -116,7 +116,7 @@ public static function GetIterator(Isolate $isolate): SymbolValue * * @return SymbolValue */ - public static function GetMatch(Isolate $isolate): SymbolValue + public static function getMatch(Isolate $isolate): SymbolValue { } @@ -125,7 +125,7 @@ public static function GetMatch(Isolate $isolate): SymbolValue * * @return SymbolValue */ - public static function GetReplace(Isolate $isolate): SymbolValue + public static function getReplace(Isolate $isolate): SymbolValue { } @@ -134,7 +134,7 @@ public static function GetReplace(Isolate $isolate): SymbolValue * * @return SymbolValue */ - public static function GetSearch(Isolate $isolate): SymbolValue + public static function getSearch(Isolate $isolate): SymbolValue { } @@ -143,7 +143,7 @@ public static function GetSearch(Isolate $isolate): SymbolValue * * @return SymbolValue */ - public static function GetSplit(Isolate $isolate): SymbolValue + public static function getSplit(Isolate $isolate): SymbolValue { } @@ -152,7 +152,7 @@ public static function GetSplit(Isolate $isolate): SymbolValue * * @return SymbolValue */ - public static function GetToPrimitive(Isolate $isolate): SymbolValue + public static function getToPrimitive(Isolate $isolate): SymbolValue { } @@ -161,7 +161,7 @@ public static function GetToPrimitive(Isolate $isolate): SymbolValue * * @return SymbolValue */ - public static function GetToStringTag(Isolate $isolate): SymbolValue + public static function getToStringTag(Isolate $isolate): SymbolValue { } @@ -170,7 +170,7 @@ public static function GetToStringTag(Isolate $isolate): SymbolValue * * @return SymbolValue */ - public static function GetUnscopables(Isolate $isolate): SymbolValue + public static function getUnscopables(Isolate $isolate): SymbolValue { } } diff --git a/stubs/src/Template.php b/stubs/src/Template.php index 17341d1..5fb9032 100644 --- a/stubs/src/Template.php +++ b/stubs/src/Template.php @@ -34,7 +34,7 @@ public function __construct(\V8\Isolate $isolate) /** * @return \V8\Isolate */ - public function GetIsolate(): Isolate + public function getIsolate(): Isolate { return $this->isolate; } @@ -48,7 +48,7 @@ public function GetIsolate(): Isolate * * @return void */ - public function Set(NameValue $name, /*Data*/ $value, int $attributes = PropertyAttribute::None) + public function set(NameValue $name, /*Data*/ $value, int $attributes = PropertyAttribute::None) { } @@ -59,7 +59,7 @@ public function Set(NameValue $name, /*Data*/ $value, int $attributes = Property * @param int $attribute * @param int $settings */ - public function SetAccessorProperty( + public function setAccessorProperty( NameValue $name, FunctionTemplate $getter = null, FunctionTemplate $setter = null, @@ -92,7 +92,7 @@ public function SetAccessorProperty( * * @param int $settings Access control settings for the accessor. */ - public function SetNativeDataProperty( + public function setNativeDataProperty( NameValue $name, callable $getter, callable $setter = null, diff --git a/stubs/src/TryCatch.php b/stubs/src/TryCatch.php index 0746acb..fa8fea1 100644 --- a/stubs/src/TryCatch.php +++ b/stubs/src/TryCatch.php @@ -88,12 +88,18 @@ public function __construct( $this->external_exception = $external_exception; } - public function GetIsolate(): Isolate + /** + * @return \V8\Isolate + */ + public function getIsolate(): Isolate { return $this->isolate; } - public function GetContext(): Context + /** + * @return \V8\Context + */ + public function getContext(): Context { return $this->context; } @@ -104,10 +110,10 @@ public function GetContext(): Context * * The returned handle is valid until this TryCatch block has been destroyed. * - * @return \V8\Value | null + * @return \V8\Value|null * */ - public function Exception() + public function exception() { return $this->exception; } @@ -116,9 +122,9 @@ public function Exception() * Returns the .stack property of the thrown object. If no .stack * property is present an empty handle is returned. * - * @return Value | null + * @return \V8\Value|null */ - public function StackTrace() + public function stackTrace() { return $this->stack_trace; } @@ -130,9 +136,9 @@ public function StackTrace() * The returned handle is valid until this TryCatch block has been * destroyed. * - * @return Message | null + * @return Message|null */ - public function Message() + public function message() { return $this->message; } @@ -147,7 +153,7 @@ public function Message() * * @return bool */ - public function CanContinue(): bool + public function canContinue(): bool { return $this->can_continue; } @@ -166,7 +172,7 @@ public function CanContinue(): bool * * @return bool */ - public function HasTerminated(): bool + public function hasTerminated(): bool { return $this->has_terminated; } diff --git a/stubs/src/Uint32Value.php b/stubs/src/Uint32Value.php index 473c22c..6e0f647 100644 --- a/stubs/src/Uint32Value.php +++ b/stubs/src/Uint32Value.php @@ -32,7 +32,7 @@ public function __construct(Isolate $isolate, int $value) /** * @return int uint32 value */ - public function Value(): int + public function value(): int { } } diff --git a/stubs/src/UnboundScript.php b/stubs/src/UnboundScript.php index 8b88915..9775a39 100644 --- a/stubs/src/UnboundScript.php +++ b/stubs/src/UnboundScript.php @@ -21,21 +21,21 @@ private function __construct() * * @return Script */ - public function BindToContext(Context $context): Script + public function bindToContext(Context $context): Script { } /** * @return int */ - public function GetId(): int + public function getId(): int { } /** * @return Value */ - public function GetScriptName(): Value + public function getScriptName(): Value { } @@ -44,7 +44,7 @@ public function GetScriptName(): Value * * @return Value */ - public function GetSourceURL(): Value + public function getSourceURL(): Value { } @@ -53,7 +53,7 @@ public function GetSourceURL(): Value * * @return Value */ - public function GetSourceMappingURL(): Value + public function getSourceMappingURL(): Value { } @@ -65,7 +65,7 @@ public function GetSourceMappingURL(): Value * * @return int */ - public function GetLineNumber(int $code_pos): int + public function getLineNumber(int $code_pos): int { } } diff --git a/stubs/src/UndefinedValue.php b/stubs/src/UndefinedValue.php index c66789b..bd3192d 100644 --- a/stubs/src/UndefinedValue.php +++ b/stubs/src/UndefinedValue.php @@ -27,7 +27,7 @@ public function __construct(Isolate $isolate) /** * @return null */ - public function Value() + public function value() { } } diff --git a/stubs/src/Value.php b/stubs/src/Value.php index c974bf0..32b4e9a 100644 --- a/stubs/src/Value.php +++ b/stubs/src/Value.php @@ -24,7 +24,7 @@ abstract class Value extends Data /** * @return \V8\Isolate */ - public function GetIsolate(): Isolate + public function getIsolate(): Isolate { } @@ -33,7 +33,7 @@ public function GetIsolate(): Isolate * * @return bool */ - public function IsUndefined(): bool + public function isUndefined(): bool { } @@ -42,7 +42,7 @@ public function IsUndefined(): bool * * @return bool */ - public function IsNull(): bool + public function isNull(): bool { } @@ -51,7 +51,7 @@ public function IsNull(): bool * * @return bool */ - public function IsTrue(): bool + public function isTrue(): bool { } @@ -60,7 +60,7 @@ public function IsTrue(): bool * * @return bool */ - public function IsFalse(): bool + public function isFalse(): bool { } @@ -70,7 +70,7 @@ public function IsFalse(): bool * * @return bool */ - public function IsName(): bool + public function isName(): bool { } @@ -79,7 +79,7 @@ public function IsName(): bool * * @return bool */ - public function IsString(): bool + public function isString(): bool { } @@ -88,7 +88,7 @@ public function IsString(): bool * * @return bool */ - public function IsSymbol(): bool + public function isSymbol(): bool { } @@ -97,7 +97,7 @@ public function IsSymbol(): bool * * @return bool */ - public function IsFunction(): bool + public function isFunction(): bool { } @@ -106,7 +106,7 @@ public function IsFunction(): bool * * @return bool */ - public function IsArray(): bool + public function isArray(): bool { } @@ -115,7 +115,7 @@ public function IsArray(): bool * * @return bool */ - public function IsObject(): bool + public function isObject(): bool { } @@ -124,7 +124,7 @@ public function IsObject(): bool * * @return bool */ - public function IsBoolean(): bool + public function isBoolean(): bool { } @@ -133,7 +133,7 @@ public function IsBoolean(): bool * * @return bool */ - public function IsNumber(): bool + public function isNumber(): bool { } @@ -142,7 +142,7 @@ public function IsNumber(): bool * * @return bool */ - public function IsInt32(): bool + public function isInt32(): bool { } @@ -151,7 +151,7 @@ public function IsInt32(): bool * * @return bool */ - public function IsUint32(): bool + public function isUint32(): bool { } @@ -160,7 +160,7 @@ public function IsUint32(): bool * * @return bool */ - public function IsDate(): bool + public function isDate(): bool { } @@ -169,7 +169,7 @@ public function IsDate(): bool * * @return bool */ - public function IsArgumentsObject(): bool + public function isArgumentsObject(): bool { } @@ -178,7 +178,7 @@ public function IsArgumentsObject(): bool * * @return bool */ - public function IsBooleanObject(): bool + public function isBooleanObject(): bool { } @@ -187,7 +187,7 @@ public function IsBooleanObject(): bool * * @return bool */ - public function IsNumberObject(): bool + public function isNumberObject(): bool { } @@ -196,14 +196,14 @@ public function IsNumberObject(): bool * * @return bool */ - public function IsStringObject(): bool + public function isStringObject(): bool { } /** * Returns true if this value is a Symbol object. */ - public function IsSymbolObject(): bool + public function isSymbolObject(): bool { } @@ -212,7 +212,7 @@ public function IsSymbolObject(): bool * * @return bool */ - public function IsNativeError(): bool + public function isNativeError(): bool { } @@ -221,7 +221,7 @@ public function IsNativeError(): bool * * @return bool */ - public function IsRegExp(): bool + public function isRegExp(): bool { } @@ -231,7 +231,7 @@ public function IsRegExp(): bool * * @return \V8\BooleanValue */ - public function ToBoolean(Context $context) + public function toBoolean(Context $context) { } @@ -240,7 +240,7 @@ public function ToBoolean(Context $context) * * @return \V8\NumberValue */ - public function ToNumber(Context $context) + public function toNumber(Context $context) { } @@ -249,7 +249,7 @@ public function ToNumber(Context $context) * * @return \V8\StringValue */ - public function ToString(Context $context) + public function toString(Context $context) { } @@ -258,7 +258,7 @@ public function ToString(Context $context) * * @return \V8\StringValue */ - public function ToDetailString(Context $context) + public function toDetailString(Context $context) { } @@ -268,7 +268,7 @@ public function ToDetailString(Context $context) * * @return \V8\ObjectValue */ - public function ToObject(Context $context) + public function toObject(Context $context) { } @@ -278,7 +278,7 @@ public function ToObject(Context $context) * * @return \V8\IntegerValue */ - public function ToInteger(Context $context) + public function toInteger(Context $context) { } @@ -288,7 +288,7 @@ public function ToInteger(Context $context) * * @return \V8\Uint32Value */ - public function ToUint32(Context $context) + public function toUint32(Context $context) { } @@ -297,7 +297,7 @@ public function ToUint32(Context $context) * * @return \V8\Int32Value */ - public function ToInt32(Context $context) + public function toInt32(Context $context) { } @@ -309,7 +309,7 @@ public function ToInt32(Context $context) * * @return \V8\Uint32Value */ - public function ToArrayIndex(Context $context) + public function toArrayIndex(Context $context) { } @@ -318,7 +318,7 @@ public function ToArrayIndex(Context $context) * * @return bool */ - public function BooleanValue(Context $context) + public function booleanValue(Context $context) { } @@ -327,7 +327,7 @@ public function BooleanValue(Context $context) * * @return double */ - public function NumberValue(Context $context) + public function numberValue(Context $context) { } @@ -336,7 +336,7 @@ public function NumberValue(Context $context) * * @return int | double */ - public function IntegerValue(Context $context) + public function integerValue(Context $context) { } @@ -345,7 +345,7 @@ public function IntegerValue(Context $context) * * @return int */ - public function Uint32Value(Context $context) + public function uint32Value(Context $context) { } @@ -354,7 +354,7 @@ public function Uint32Value(Context $context) * * @return int */ - public function Int32Value(Context $context) + public function int32Value(Context $context) { } @@ -368,7 +368,7 @@ public function Int32Value(Context $context) * * @return bool */ - public function Equals(Context $context, Value $that): bool + public function equals(Context $context, Value $that): bool { } @@ -377,7 +377,7 @@ public function Equals(Context $context, Value $that): bool * * @return bool */ - public function StrictEquals(Value $that): bool + public function strictEquals(Value $that): bool { } @@ -386,14 +386,14 @@ public function StrictEquals(Value $that): bool * * @return bool */ - public function SameValue(Value $that): bool + public function sameValue(Value $that): bool { } /** * @return StringValue */ - public function TypeOf(): StringValue + public function typeOf(): StringValue { } @@ -403,7 +403,7 @@ public function TypeOf(): StringValue * * @return bool */ - public function InstanceOf (Context $context, ObjectValue $object): bool + public function instanceOf (Context $context, ObjectValue $object): bool { } } diff --git a/tests/.v8-helpers.php b/tests/.v8-helpers.php index 06d9b91..833aad7 100644 --- a/tests/.v8-helpers.php +++ b/tests/.v8-helpers.php @@ -39,23 +39,23 @@ public function __construct(PhpV8Testsuite $testsuite) { */ public function getStackTraceFramesAsArray(\V8\Context $context, array $frames) { - $isolate = $context->GetIsolate(); + $isolate = $context->getIsolate(); $arr = new \V8\ArrayObject($context); foreach ($frames as $i => $frame) { $f = new \V8\ObjectValue($context); - $f->Set($context, new \V8\StringValue($isolate, 'line'), new \V8\NumberValue($isolate, $frame->GetLineNumber())); - $f->Set($context, new \V8\StringValue($isolate, 'column'), new \V8\NumberValue($isolate, $frame->GetColumn())); - $f->Set($context, new \V8\StringValue($isolate, 'scriptId'), new \V8\NumberValue($isolate, $frame->GetScriptId())); - $f->Set($context, new \V8\StringValue($isolate, 'scriptName'), new \V8\StringValue($isolate, $frame->GetScriptName())); - $f->Set($context, new \V8\StringValue($isolate, 'scriptNameOrSourceURL'), new \V8\StringValue($isolate, $frame->GetScriptNameOrSourceURL())); - $f->Set($context, new \V8\StringValue($isolate, 'functionName'), new \V8\StringValue($isolate, $frame->GetFunctionName())); - $f->Set($context, new \V8\StringValue($isolate, 'isEval'), new \V8\BooleanValue($isolate, $frame->IsEval())); - $f->Set($context, new \V8\StringValue($isolate, 'isConstructor'), new \V8\BooleanValue($isolate, $frame->IsConstructor())); + $f->set($context, new \V8\StringValue($isolate, 'line'), new \V8\NumberValue($isolate, $frame->getLineNumber())); + $f->set($context, new \V8\StringValue($isolate, 'column'), new \V8\NumberValue($isolate, $frame->getColumn())); + $f->set($context, new \V8\StringValue($isolate, 'scriptId'), new \V8\NumberValue($isolate, $frame->getScriptId())); + $f->set($context, new \V8\StringValue($isolate, 'scriptName'), new \V8\StringValue($isolate, $frame->getScriptName())); + $f->set($context, new \V8\StringValue($isolate, 'scriptNameOrSourceURL'), new \V8\StringValue($isolate, $frame->getScriptNameOrSourceURL())); + $f->set($context, new \V8\StringValue($isolate, 'functionName'), new \V8\StringValue($isolate, $frame->getFunctionName())); + $f->set($context, new \V8\StringValue($isolate, 'isEval'), new \V8\BooleanValue($isolate, $frame->isEval())); + $f->set($context, new \V8\StringValue($isolate, 'isConstructor'), new \V8\BooleanValue($isolate, $frame->isConstructor())); - $arr->Set($context, new \V8\IntegerValue($isolate, $i), $f); + $arr->set($context, new \V8\IntegerValue($isolate, $i), $f); } return $arr; @@ -65,11 +65,11 @@ public function getPrintFunctionTemplate(\V8\Isolate $isolate, $newline = false) { $print_func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $args) use ($newline) { - $context = $args->GetContext(); + $context = $args->getContext(); $out = []; - foreach ($args->Arguments() as $arg) { + foreach ($args->arguments() as $arg) { $out[] = $this->toString($arg, $context); } @@ -80,12 +80,12 @@ public function getPrintFunctionTemplate(\V8\Isolate $isolate, $newline = false) } public function injectConsoleLog(\V8\Context $context) { - $isolate = $context->GetIsolate(); + $isolate = $context->getIsolate(); $obj_tpl = new \V8\ObjectTemplate($isolate); - $obj_tpl->Set(new \V8\StringValue($isolate, 'log'), $this->getPrintFunctionTemplate($isolate, true)); + $obj_tpl->set(new \V8\StringValue($isolate, 'log'), $this->getPrintFunctionTemplate($isolate, true)); - $console_obj = $obj_tpl->NewInstance($context); - $context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'console'), $console_obj); + $console_obj = $obj_tpl->newInstance($context); + $context->globalObject()->set($context, new \V8\StringValue($isolate, 'console'), $console_obj); return $context; } @@ -98,27 +98,27 @@ public function injectConsoleLog(\V8\Context $context) { */ public function toString(\V8\Value $arg, \V8\Context $context) { - if ($arg->IsUndefined()) { + if ($arg->isUndefined()) { return ''; } - if ($arg->IsNull()) { + if ($arg->isNull()) { return var_export(null, true); } - if ($arg->IsTrue() || $arg->IsFalse()) { - return var_export($arg->BooleanValue($context), true); + if ($arg->isTrue() || $arg->isFalse()) { + return var_export($arg->booleanValue($context), true); } - if ($arg->IsArray()) { - $len = $arg->Length(); + if ($arg->isArray()) { + $len = $arg->length(); $items = ''; if ($len > 0) { $items = []; for($i =0; $i < $len; $i++) { - $item = $arg->Get($context, new \V8\NumberValue($context->GetIsolate(), $i)); + $item = $arg->get($context, new \V8\NumberValue($context->getIsolate(), $i)); $items[] = $this->toString($item, $context); } @@ -129,28 +129,29 @@ public function toString(\V8\Value $arg, \V8\Context $context) return '[' . $items . ']'; } - if ($arg->IsSymbol()) { - return '{Symbol: ' . $arg->Name()->Value() . '}'; + if ($arg->isSymbol()) { + return '{Symbol: ' . $arg->name()->value() . '}'; } - if ($arg->IsSymbolObject()) { - return '{Symbol object: ' . $arg->ValueOf()->Name()->Value() . '}'; + if ($arg->isSymbolObject()) { + /** @var \V8\SymbolObject $arg */ + return '{Symbol object: ' . $arg->valueOf()->name()->value() . '}'; } - return $arg->ToString($context)->Value(); + return $arg->toString($context)->value(); } public function run_checks(\V8\Value $value, $title=null) { $title = $title ?: 'Checks on ' . get_class($value); $this->testsuite->header($title); - $filter = new ArrayListFilter(['TypeOf'], false); - $finalizer = new CallChainFinalizer([\V8\StringValue::class => 'Value'], [], false); + $filter = new ArrayListFilter(['typeOf'], false); + $finalizer = new CallChainFinalizer([\V8\StringValue::class => 'value'], [], false); $this->testsuite->dump_object_methods($value, [], $filter, $finalizer); $this->testsuite->line(); - $filter = new RegexpFilter('/^Is/'); + $filter = new RegexpFilter('/^is/'); $this->testsuite->dump_object_methods($value, [], $filter); $this->testsuite->space(); } @@ -158,12 +159,12 @@ public function run_checks(\V8\Value $value, $title=null) { public function CompileRun(\V8\Context $context, $script) { if (!($script instanceof \V8\StringValue)) { - $script = new \V8\StringValue($context->GetIsolate(), $script); + $script = new \V8\StringValue($context->getIsolate(), $script); } $script = new \V8\Script($context, $script, new \V8\ScriptOrigin('test.js')); - return $script->Run($context); + return $script->run($context); } public function CompileTryRun(\V8\Context $context, $script) { @@ -182,10 +183,10 @@ public function ExpectString(\V8\Context $context, $script, $expected) { $res = $this->CompileTryRun($context,$script); if ($res) { - if (!$res->IsString()) { + if (!$res->isString()) { echo 'Actual result for expected ', var_export($expected, true), ' is not a string', PHP_EOL; } else { - $this->testsuite->value_matches($expected, $res->Value()); + $this->testsuite->value_matches($expected, $res->value()); } } } @@ -194,12 +195,12 @@ public function ExpectBoolean(V8\Context $context, $script, $expected) { $res = $this->CompileTryRun($context, $script); if ($res) { - if (!$res->IsBoolean()) { + if (!$res->isBoolean()) { echo 'Actual result for expected value is not a boolean', PHP_EOL; return; } - $this->testsuite->value_matches($expected, $res->BooleanValue($context)); + $this->testsuite->value_matches($expected, $res->booleanValue($context)); } } @@ -218,7 +219,7 @@ public function ExpectObject(V8\Context $context, $script, \V8\Value $expected) return; } - if (!$res->SameValue($expected)) { + if (!$res->sameValue($expected)) { echo 'Actual and expected objects are not the same', PHP_EOL; } else { echo 'Actual and expected objects are the same', PHP_EOL; @@ -232,7 +233,7 @@ public function ExpectUndefined(V8\Context $context, $script) { return; } - if (!$res->IsUndefined()) { + if (!$res->isUndefined()) { echo 'Actual result for expected value is not undefined', PHP_EOL; } else { echo 'Actual result for expected value is undefined', PHP_EOL; @@ -246,13 +247,13 @@ public function ExpectNumber(V8\Context $context, $script, $expected=null) { return; } - if (!$res->IsNumber()) { + if (!$res->isNumber()) { echo 'Actual result for expected value is not a number', PHP_EOL; return; } if ($expected !== null) { - $this->testsuite->value_matches($expected, $res->Int32Value($context)); + $this->testsuite->value_matches($expected, $res->int32Value($context)); } } diff --git a/tests/001-verify-method-case.phpt b/tests/001-verify-method-case.phpt new file mode 100644 index 0000000..1a0b278 --- /dev/null +++ b/tests/001-verify-method-case.phpt @@ -0,0 +1,59 @@ +--TEST-- +Check whether all methods follows naming convention +--SKIPIF-- + +--FILE-- +getClasses(); + + +class MethodsCaseVerifier +{ + private $invalid = []; + + public function verifyClass(ReflectionClass $class) + { + foreach ($class->getMethods() as $m) { + $this->verifyMethod($m); + } + } + + public function verifyMethod(ReflectionMethod $method) + { + if (strtolower($method->getName()[0]) == $method->getName()[0]) { + return; + } + + $method_name = $method->getDeclaringClass()->getName() . '::' . $method->getName(); + + if (isset($this->invalid[$method_name])) { + return; + } + + $this->invalid[$method_name] = true; + + echo "{$method_name}() - invalid method name", PHP_EOL; + } + + public function isValid() + { + return empty($this->invalid); + } +} + +$v = new MethodsCaseVerifier(); + + +foreach ($classes as $c) { + $v->verifyClass($c); +} + +if ($v->isValid()) { + echo 'All methods are valid', PHP_EOL; +} + +?> +--EXPECT-- +All methods are valid diff --git a/tests/003-V8ObjectTemplate_recursive_chain.phpt b/tests/003-V8ObjectTemplate_recursive_chain.phpt index fc87720..8180656 100644 --- a/tests/003-V8ObjectTemplate_recursive_chain.phpt +++ b/tests/003-V8ObjectTemplate_recursive_chain.phpt @@ -21,18 +21,18 @@ $template1 = new \V8\ObjectTemplate($isolate); $template2 = new \V8\ObjectTemplate($isolate); $template3 = new \V8\ObjectTemplate($isolate); -$template1->Set(new \V8\StringValue($isolate, 'that2'), $template2); -$template2->Set(new \V8\StringValue($isolate, 'that3'), $template3); +$template1->set(new \V8\StringValue($isolate, 'that2'), $template2); +$template2->set(new \V8\StringValue($isolate, 'that3'), $template3); try { - $template3->Set(new \V8\StringValue($isolate, 'that1'), $template2); + $template3->set(new \V8\StringValue($isolate, 'that1'), $template2); } catch (Exception $e) { $helper->exception_export($e); } $context = new \V8\Context($isolate); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test'), $template1->NewInstance($context)); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test'), $template1->newInstance($context)); ?> --EXPECT-- diff --git a/tests/003-V8ObjectTemplate_recursive_global.phpt b/tests/003-V8ObjectTemplate_recursive_global.phpt index 62b9444..2fd53d4 100644 --- a/tests/003-V8ObjectTemplate_recursive_global.phpt +++ b/tests/003-V8ObjectTemplate_recursive_global.phpt @@ -20,7 +20,7 @@ $isolate = new \V8\Isolate(); $template = new \V8\ObjectTemplate($isolate); try { - $template->Set(new \V8\StringValue($isolate, 'self'), $template); + $template->set(new \V8\StringValue($isolate, 'self'), $template); } catch (Exception $e) { $helper->exception_export($e); } diff --git a/tests/003-V8ObjectTemplate_recursive_self.phpt b/tests/003-V8ObjectTemplate_recursive_self.phpt index 928cfa9..351f83d 100644 --- a/tests/003-V8ObjectTemplate_recursive_self.phpt +++ b/tests/003-V8ObjectTemplate_recursive_self.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectTemplate::Set() - recursive self +V8\ObjectTemplate::set() - recursive self --SKIPIF-- --FILE-- @@ -20,13 +20,13 @@ $isolate = new \V8\Isolate(); $template = new \V8\ObjectTemplate($isolate); try { - $template->Set(new \V8\StringValue($isolate, 'self'), $template); + $template->set(new \V8\StringValue($isolate, 'self'), $template); } catch (Exception $e) { $helper->exception_export($e); } $context = new \V8\Context($isolate); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test'), $template->NewInstance($context)); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test'), $template->newInstance($context)); ?> --EXPECT-- diff --git a/tests/003-V8ObjectTemplate_recursive_tree.phpt b/tests/003-V8ObjectTemplate_recursive_tree.phpt index 266fede..be4cfa1 100644 --- a/tests/003-V8ObjectTemplate_recursive_tree.phpt +++ b/tests/003-V8ObjectTemplate_recursive_tree.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectTemplate::Set() - recursive tree +V8\ObjectTemplate::set() - recursive tree --SKIPIF-- --FILE-- @@ -33,42 +33,42 @@ $t9 = new \V8\ObjectTemplate($isolate); $s9 = new \V8\StringValue($isolate, 't9' // / \ // 8 9 -$t1->Set($s2, $t2); +$t1->set($s2, $t2); -$t2->Set($s3, $t3); -$t2->Set($s4, $t4); +$t2->set($s3, $t3); +$t2->set($s4, $t4); -$t1->Set($s5, $t5); +$t1->set($s5, $t5); -$t5->Set($s6, $t6); -$t5->Set($s7, $t7); +$t5->set($s6, $t6); +$t5->set($s7, $t7); -$t7->Set($s8, $t8); -$t7->Set($s9, $t9); +$t7->set($s8, $t8); +$t7->set($s9, $t9); try { - $t9->Set($s1, $t1); + $t9->set($s1, $t1); } catch (\V8\Exceptions\Exception $e) { $helper->exception_export($e); } try { - $t7->Set($s1, $t1); + $t7->set($s1, $t1); } catch (\V8\Exceptions\Exception $e) { $helper->exception_export($e); } -$t4->Set($s6, $t6); +$t4->set($s6, $t6); try { - $t6->Set($s4, $t4); + $t6->set($s4, $t4); } catch (\V8\Exceptions\Exception $e) { $helper->exception_export($e); } $context = new \V8\Context($isolate); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test'), $t1->NewInstance($context)); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test'), $t1->newInstance($context)); ?> --EXPECT-- diff --git a/tests/004-ICU-Intl_DateTimeFormat.phpt b/tests/004-ICU-Intl_dateTimeFormat.phpt similarity index 98% rename from tests/004-ICU-Intl_DateTimeFormat.phpt rename to tests/004-ICU-Intl_dateTimeFormat.phpt index ddab912..2bbd162 100644 --- a/tests/004-ICU-Intl_DateTimeFormat.phpt +++ b/tests/004-ICU-Intl_dateTimeFormat.phpt @@ -55,7 +55,7 @@ console.log(new Intl.DateTimeFormat(['ban', 'id']).format(date)); // → "20/12/2012" HEREDOC; -(new \V8\Script($context, new \V8\StringValue($isolate, $source)))->Run($context); +(new \V8\Script($context, new \V8\StringValue($isolate, $source)))->run($context); $helper->line(); @@ -95,7 +95,7 @@ console.log(date.toLocaleString('en-US', options)); // → "12/19/2012, 19:00:00" HEREDOC; -(new \V8\Script($context, new \V8\StringValue($isolate, $source)))->Run($context); +(new \V8\Script($context, new \V8\StringValue($isolate, $source)))->run($context); $helper->line(); @@ -116,7 +116,7 @@ console.log(new Intl.DateTimeFormat('de-DE', options).format(date)); HEREDOC; -(new \V8\Script($context, new \V8\StringValue($isolate, $source)))->Run($context); +(new \V8\Script($context, new \V8\StringValue($isolate, $source)))->run($context); ?> diff --git a/tests/004-ICU-Intl_NumberFormat.phpt b/tests/004-ICU-Intl_numberFormat.phpt similarity index 100% rename from tests/004-ICU-Intl_NumberFormat.phpt rename to tests/004-ICU-Intl_numberFormat.phpt diff --git a/tests/005-V8FunctionTemplate_external_memory.phpt b/tests/005-V8FunctionTemplate_external_memory.phpt index 3662fef..a6f68c0 100644 --- a/tests/005-V8FunctionTemplate_external_memory.phpt +++ b/tests/005-V8FunctionTemplate_external_memory.phpt @@ -16,11 +16,11 @@ $isolate = new \V8\Isolate(); $value = new \V8\FunctionTemplate($isolate); -$helper->inline('Adjusted external memory size by default', $value->GetExternalAllocatedMemory()); -$helper->inline('After adjusting from zero to 1kb', $value->AdjustExternalAllocatedMemory(1024)); -$helper->inline('After adjusting from 1kb to 2kb', $value->AdjustExternalAllocatedMemory(1024)); -$helper->inline('After adjusting down from 2kb to 1kb', $value->AdjustExternalAllocatedMemory(-1024)); -$helper->inline('After adjusting down to more that was adjusted initially', $value->AdjustExternalAllocatedMemory(-9999999999)); +$helper->inline('Adjusted external memory size by default', $value->getExternalAllocatedMemory()); +$helper->inline('After adjusting from zero to 1kb', $value->adjustExternalAllocatedMemory(1024)); +$helper->inline('After adjusting from 1kb to 2kb', $value->adjustExternalAllocatedMemory(1024)); +$helper->inline('After adjusting down from 2kb to 1kb', $value->adjustExternalAllocatedMemory(-1024)); +$helper->inline('After adjusting down to more that was adjusted initially', $value->adjustExternalAllocatedMemory(-9999999999)); $helper->line(); ?> diff --git a/tests/005-V8ObjectTemplate_external_memory.phpt b/tests/005-V8ObjectTemplate_external_memory.phpt index 8461724..7cd6bc1 100644 --- a/tests/005-V8ObjectTemplate_external_memory.phpt +++ b/tests/005-V8ObjectTemplate_external_memory.phpt @@ -16,11 +16,11 @@ $isolate = new \V8\Isolate(); $value = new \V8\ObjectTemplate($isolate); -$helper->inline('Adjusted external memory size by default', $value->GetExternalAllocatedMemory()); -$helper->inline('After adjusting from zero to 1kb', $value->AdjustExternalAllocatedMemory(1024)); -$helper->inline('After adjusting from 1kb to 2kb', $value->AdjustExternalAllocatedMemory(1024)); -$helper->inline('After adjusting down from 2kb to 1kb', $value->AdjustExternalAllocatedMemory(-1024)); -$helper->inline('After adjusting down to more that was adjusted initially', $value->AdjustExternalAllocatedMemory(-9999999999)); +$helper->inline('Adjusted external memory size by default', $value->getExternalAllocatedMemory()); +$helper->inline('After adjusting from zero to 1kb', $value->adjustExternalAllocatedMemory(1024)); +$helper->inline('After adjusting from 1kb to 2kb', $value->adjustExternalAllocatedMemory(1024)); +$helper->inline('After adjusting down from 2kb to 1kb', $value->adjustExternalAllocatedMemory(-1024)); +$helper->inline('After adjusting down to more that was adjusted initially', $value->adjustExternalAllocatedMemory(-9999999999)); $helper->line(); ?> diff --git a/tests/005-V8ObjectValue_external_memory.phpt b/tests/005-V8ObjectValue_external_memory.phpt index 1a28947..9eb6cb7 100644 --- a/tests/005-V8ObjectValue_external_memory.phpt +++ b/tests/005-V8ObjectValue_external_memory.phpt @@ -16,11 +16,11 @@ $isolate = new \V8\Isolate(); $context = new \V8\Context($isolate); $value = new \V8\ObjectValue($context); -$helper->inline('Adjusted external memory size by default', $value->GetExternalAllocatedMemory()); -$helper->inline('After adjusting from zero to 1kb', $value->AdjustExternalAllocatedMemory(1024)); -$helper->inline('After adjusting from 1kb to 2kb', $value->AdjustExternalAllocatedMemory(1024)); -$helper->inline('After adjusting down from 2kb to 1kb', $value->AdjustExternalAllocatedMemory(-1024)); -$helper->inline('After adjusting down to more that was adjusted initially', $value->AdjustExternalAllocatedMemory(-9999999999)); +$helper->inline('Adjusted external memory size by default', $value->getExternalAllocatedMemory()); +$helper->inline('After adjusting from zero to 1kb', $value->adjustExternalAllocatedMemory(1024)); +$helper->inline('After adjusting from 1kb to 2kb', $value->adjustExternalAllocatedMemory(1024)); +$helper->inline('After adjusting down from 2kb to 1kb', $value->adjustExternalAllocatedMemory(-1024)); +$helper->inline('After adjusting down to more that was adjusted initially', $value->adjustExternalAllocatedMemory(-9999999999)); $helper->line(); ?> diff --git a/tests/V8ArrayObject.phpt b/tests/V8ArrayObject.phpt index f1ccb2c..e9a5a59 100644 --- a/tests/V8ArrayObject.phpt +++ b/tests/V8ArrayObject.phpt @@ -22,29 +22,29 @@ $helper->dump($value); $helper->space(); $helper->assert('ArrayObject extends ObjectValue', $value instanceof \V8\ObjectValue); -$helper->assert('ArrayObject is instanceof Array', $value->InstanceOf($context, $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'Array')))); +$helper->assert('ArrayObject is instanceof Array', $value->instanceOf($context, $context->globalObject()->get($context, new \V8\StringValue($isolate, 'Array')))); $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_matches($value, 'GetContext', $context); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_matches($value, 'getContext', $context); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); $helper->header('Converters'); -$helper->dump_object_methods($value, ['@@default' => [$context]], new RegexpFilter('/^To/')); +$helper->dump_object_methods($value, ['@@default' => [$context]], new RegexpFilter('/^to/')); $helper->space(); -$value->Set($context, new \V8\Uint32Value($isolate, 0), new \V8\StringValue($isolate, 'first')); -$value->Set($context, new \V8\Uint32Value($isolate, 1), new \V8\StringValue($isolate, 'second')); -$value->Set($context, new \V8\Uint32Value($isolate, 2), new \V8\StringValue($isolate, 'third')); +$value->set($context, new \V8\Uint32Value($isolate, 0), new \V8\StringValue($isolate, 'first')); +$value->set($context, new \V8\Uint32Value($isolate, 1), new \V8\StringValue($isolate, 'second')); +$value->set($context, new \V8\Uint32Value($isolate, 2), new \V8\StringValue($isolate, 'third')); -$value->Set($context, new \V8\StringValue($isolate, 'test'), new \V8\StringValue($isolate, 'property')); +$value->set($context, new \V8\StringValue($isolate, 'test'), new \V8\StringValue($isolate, 'property')); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'arr'), $value); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'arr'), $value); $source = ' console.log("typeof arr: ", typeof arr); @@ -79,93 +79,93 @@ ArrayObject is instanceof Array: ok Accessors: ---------- -V8\ArrayObject::GetIsolate() matches expected value -V8\ArrayObject::GetContext() matches expected value +V8\ArrayObject::getIsolate() matches expected value +V8\ArrayObject::getContext() matches expected value Checkers: --------- -V8\ArrayObject(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\ArrayObject(V8\ObjectValue)->IsCallable(): bool(false) -V8\ArrayObject(V8\ObjectValue)->IsConstructor(): bool(false) -V8\ArrayObject(V8\Value)->IsUndefined(): bool(false) -V8\ArrayObject(V8\Value)->IsNull(): bool(false) -V8\ArrayObject(V8\Value)->IsNullOrUndefined(): bool(false) -V8\ArrayObject(V8\Value)->IsTrue(): bool(false) -V8\ArrayObject(V8\Value)->IsFalse(): bool(false) -V8\ArrayObject(V8\Value)->IsName(): bool(false) -V8\ArrayObject(V8\Value)->IsString(): bool(false) -V8\ArrayObject(V8\Value)->IsSymbol(): bool(false) -V8\ArrayObject(V8\Value)->IsFunction(): bool(false) -V8\ArrayObject(V8\Value)->IsArray(): bool(true) -V8\ArrayObject(V8\Value)->IsObject(): bool(true) -V8\ArrayObject(V8\Value)->IsBoolean(): bool(false) -V8\ArrayObject(V8\Value)->IsNumber(): bool(false) -V8\ArrayObject(V8\Value)->IsInt32(): bool(false) -V8\ArrayObject(V8\Value)->IsUint32(): bool(false) -V8\ArrayObject(V8\Value)->IsDate(): bool(false) -V8\ArrayObject(V8\Value)->IsArgumentsObject(): bool(false) -V8\ArrayObject(V8\Value)->IsBooleanObject(): bool(false) -V8\ArrayObject(V8\Value)->IsNumberObject(): bool(false) -V8\ArrayObject(V8\Value)->IsStringObject(): bool(false) -V8\ArrayObject(V8\Value)->IsSymbolObject(): bool(false) -V8\ArrayObject(V8\Value)->IsNativeError(): bool(false) -V8\ArrayObject(V8\Value)->IsRegExp(): bool(false) -V8\ArrayObject(V8\Value)->IsAsyncFunction(): bool(false) -V8\ArrayObject(V8\Value)->IsGeneratorFunction(): bool(false) -V8\ArrayObject(V8\Value)->IsGeneratorObject(): bool(false) -V8\ArrayObject(V8\Value)->IsPromise(): bool(false) -V8\ArrayObject(V8\Value)->IsMap(): bool(false) -V8\ArrayObject(V8\Value)->IsSet(): bool(false) -V8\ArrayObject(V8\Value)->IsMapIterator(): bool(false) -V8\ArrayObject(V8\Value)->IsSetIterator(): bool(false) -V8\ArrayObject(V8\Value)->IsWeakMap(): bool(false) -V8\ArrayObject(V8\Value)->IsWeakSet(): bool(false) -V8\ArrayObject(V8\Value)->IsArrayBuffer(): bool(false) -V8\ArrayObject(V8\Value)->IsArrayBufferView(): bool(false) -V8\ArrayObject(V8\Value)->IsTypedArray(): bool(false) -V8\ArrayObject(V8\Value)->IsUint8Array(): bool(false) -V8\ArrayObject(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\ArrayObject(V8\Value)->IsInt8Array(): bool(false) -V8\ArrayObject(V8\Value)->IsUint16Array(): bool(false) -V8\ArrayObject(V8\Value)->IsInt16Array(): bool(false) -V8\ArrayObject(V8\Value)->IsUint32Array(): bool(false) -V8\ArrayObject(V8\Value)->IsInt32Array(): bool(false) -V8\ArrayObject(V8\Value)->IsFloat32Array(): bool(false) -V8\ArrayObject(V8\Value)->IsFloat64Array(): bool(false) -V8\ArrayObject(V8\Value)->IsDataView(): bool(false) -V8\ArrayObject(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\ArrayObject(V8\Value)->IsProxy(): bool(false) +V8\ArrayObject(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\ArrayObject(V8\ObjectValue)->isCallable(): bool(false) +V8\ArrayObject(V8\ObjectValue)->isConstructor(): bool(false) +V8\ArrayObject(V8\Value)->isUndefined(): bool(false) +V8\ArrayObject(V8\Value)->isNull(): bool(false) +V8\ArrayObject(V8\Value)->isNullOrUndefined(): bool(false) +V8\ArrayObject(V8\Value)->isTrue(): bool(false) +V8\ArrayObject(V8\Value)->isFalse(): bool(false) +V8\ArrayObject(V8\Value)->isName(): bool(false) +V8\ArrayObject(V8\Value)->isString(): bool(false) +V8\ArrayObject(V8\Value)->isSymbol(): bool(false) +V8\ArrayObject(V8\Value)->isFunction(): bool(false) +V8\ArrayObject(V8\Value)->isArray(): bool(true) +V8\ArrayObject(V8\Value)->isObject(): bool(true) +V8\ArrayObject(V8\Value)->isBoolean(): bool(false) +V8\ArrayObject(V8\Value)->isNumber(): bool(false) +V8\ArrayObject(V8\Value)->isInt32(): bool(false) +V8\ArrayObject(V8\Value)->isUint32(): bool(false) +V8\ArrayObject(V8\Value)->isDate(): bool(false) +V8\ArrayObject(V8\Value)->isArgumentsObject(): bool(false) +V8\ArrayObject(V8\Value)->isBooleanObject(): bool(false) +V8\ArrayObject(V8\Value)->isNumberObject(): bool(false) +V8\ArrayObject(V8\Value)->isStringObject(): bool(false) +V8\ArrayObject(V8\Value)->isSymbolObject(): bool(false) +V8\ArrayObject(V8\Value)->isNativeError(): bool(false) +V8\ArrayObject(V8\Value)->isRegExp(): bool(false) +V8\ArrayObject(V8\Value)->isAsyncFunction(): bool(false) +V8\ArrayObject(V8\Value)->isGeneratorFunction(): bool(false) +V8\ArrayObject(V8\Value)->isGeneratorObject(): bool(false) +V8\ArrayObject(V8\Value)->isPromise(): bool(false) +V8\ArrayObject(V8\Value)->isMap(): bool(false) +V8\ArrayObject(V8\Value)->isSet(): bool(false) +V8\ArrayObject(V8\Value)->isMapIterator(): bool(false) +V8\ArrayObject(V8\Value)->isSetIterator(): bool(false) +V8\ArrayObject(V8\Value)->isWeakMap(): bool(false) +V8\ArrayObject(V8\Value)->isWeakSet(): bool(false) +V8\ArrayObject(V8\Value)->isArrayBuffer(): bool(false) +V8\ArrayObject(V8\Value)->isArrayBufferView(): bool(false) +V8\ArrayObject(V8\Value)->isTypedArray(): bool(false) +V8\ArrayObject(V8\Value)->isUint8Array(): bool(false) +V8\ArrayObject(V8\Value)->isUint8ClampedArray(): bool(false) +V8\ArrayObject(V8\Value)->isInt8Array(): bool(false) +V8\ArrayObject(V8\Value)->isUint16Array(): bool(false) +V8\ArrayObject(V8\Value)->isInt16Array(): bool(false) +V8\ArrayObject(V8\Value)->isUint32Array(): bool(false) +V8\ArrayObject(V8\Value)->isInt32Array(): bool(false) +V8\ArrayObject(V8\Value)->isFloat32Array(): bool(false) +V8\ArrayObject(V8\Value)->isFloat64Array(): bool(false) +V8\ArrayObject(V8\Value)->isDataView(): bool(false) +V8\ArrayObject(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\ArrayObject(V8\Value)->isProxy(): bool(false) Converters: ----------- -V8\ArrayObject(V8\Value)->ToBoolean(): +V8\ArrayObject(V8\Value)->toBoolean(): object(V8\BooleanValue)#118 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ArrayObject(V8\Value)->ToNumber(): +V8\ArrayObject(V8\Value)->toNumber(): object(V8\Int32Value)#118 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ArrayObject(V8\Value)->ToString(): +V8\ArrayObject(V8\Value)->toString(): object(V8\StringValue)#118 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ArrayObject(V8\Value)->ToDetailString(): +V8\ArrayObject(V8\Value)->toDetailString(): object(V8\StringValue)#118 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ArrayObject(V8\Value)->ToObject(): +V8\ArrayObject(V8\Value)->toObject(): object(V8\ArrayObject)#6 (2) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { @@ -177,25 +177,25 @@ V8\ArrayObject(V8\Value)->ToObject(): } } } -V8\ArrayObject(V8\Value)->ToInteger(): +V8\ArrayObject(V8\Value)->toInteger(): object(V8\Int32Value)#118 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ArrayObject(V8\Value)->ToUint32(): +V8\ArrayObject(V8\Value)->toUint32(): object(V8\Int32Value)#118 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ArrayObject(V8\Value)->ToInt32(): +V8\ArrayObject(V8\Value)->toInt32(): object(V8\Int32Value)#118 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ArrayObject(V8\Value)->ToArrayIndex(): V8\Exceptions\Exception: Failed to convert +V8\ArrayObject(V8\Value)->toArrayIndex(): V8\Exceptions\Exception: Failed to convert typeof arr: object diff --git a/tests/V8ArrayObject_Length.phpt b/tests/V8ArrayObject_length.phpt similarity index 73% rename from tests/V8ArrayObject_Length.phpt rename to tests/V8ArrayObject_length.phpt index 91f0cda..d7374a6 100644 --- a/tests/V8ArrayObject_Length.phpt +++ b/tests/V8ArrayObject_length.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ArrayObject::Length +V8\ArrayObject::length() --SKIPIF-- --FILE-- @@ -15,17 +15,17 @@ $context = new V8\Context($isolate); $res = $v8_helper->CompileRun($context, '[1,2,3]'); -echo $res->Length(), PHP_EOL; +echo $res->length(), PHP_EOL; $arr = new \V8\ArrayObject($context, 5); -echo $arr->Length(), PHP_EOL; +echo $arr->length(), PHP_EOL; for ($i =0; $i < 7; $i++) { - $arr->Set($context, new \V8\Uint32Value($isolate, $i), new \V8\StringValue($isolate, 'test-'.$i)); + $arr->set($context, new \V8\Uint32Value($isolate, $i), new \V8\StringValue($isolate, 'test-'.$i)); } -echo $arr->Length(), PHP_EOL; +echo $arr->length(), PHP_EOL; ?> --EXPECT-- diff --git a/tests/V8Boolean.phpt b/tests/V8Boolean.phpt index 092f611..6a5e8ff 100644 --- a/tests/V8Boolean.phpt +++ b/tests/V8Boolean.phpt @@ -26,8 +26,8 @@ $helper->assert('BooleanValue extends PrimitiveValue', $value instanceof \V8\Pri $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_export($value, 'Value'); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_export($value, 'value'); $helper->space(); @@ -38,14 +38,14 @@ $context = new \V8\Context($isolate, $global_template); $helper->header('Primitive converters'); -$helper->method_export($value, 'BooleanValue', [$context]); -$helper->method_export($value, 'NumberValue', [$context]); +$helper->method_export($value, 'booleanValue', [$context]); +$helper->method_export($value, 'numberValue', [$context]); $helper->space(); -$helper->header(get_class($value) .'::ToString() converting'); -$string = $value->ToString($context); -$helper->dump($string->Value()); +$helper->header(get_class($value) .'::toString() converting'); +$string = $value->toString($context); +$helper->dump($string->value()); $helper->space(); @@ -64,70 +64,70 @@ BooleanValue extends PrimitiveValue: ok Accessors: ---------- -V8\BooleanValue::GetIsolate() matches expected value -V8\BooleanValue->Value(): bool(true) +V8\BooleanValue::getIsolate() matches expected value +V8\BooleanValue->value(): bool(true) Checkers: --------- -V8\BooleanValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(7) "boolean" - -V8\BooleanValue(V8\Value)->IsUndefined(): bool(false) -V8\BooleanValue(V8\Value)->IsNull(): bool(false) -V8\BooleanValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\BooleanValue(V8\Value)->IsTrue(): bool(true) -V8\BooleanValue(V8\Value)->IsFalse(): bool(false) -V8\BooleanValue(V8\Value)->IsName(): bool(false) -V8\BooleanValue(V8\Value)->IsString(): bool(false) -V8\BooleanValue(V8\Value)->IsSymbol(): bool(false) -V8\BooleanValue(V8\Value)->IsFunction(): bool(false) -V8\BooleanValue(V8\Value)->IsArray(): bool(false) -V8\BooleanValue(V8\Value)->IsObject(): bool(false) -V8\BooleanValue(V8\Value)->IsBoolean(): bool(true) -V8\BooleanValue(V8\Value)->IsNumber(): bool(false) -V8\BooleanValue(V8\Value)->IsInt32(): bool(false) -V8\BooleanValue(V8\Value)->IsUint32(): bool(false) -V8\BooleanValue(V8\Value)->IsDate(): bool(false) -V8\BooleanValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\BooleanValue(V8\Value)->IsBooleanObject(): bool(false) -V8\BooleanValue(V8\Value)->IsNumberObject(): bool(false) -V8\BooleanValue(V8\Value)->IsStringObject(): bool(false) -V8\BooleanValue(V8\Value)->IsSymbolObject(): bool(false) -V8\BooleanValue(V8\Value)->IsNativeError(): bool(false) -V8\BooleanValue(V8\Value)->IsRegExp(): bool(false) -V8\BooleanValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\BooleanValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\BooleanValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\BooleanValue(V8\Value)->IsPromise(): bool(false) -V8\BooleanValue(V8\Value)->IsMap(): bool(false) -V8\BooleanValue(V8\Value)->IsSet(): bool(false) -V8\BooleanValue(V8\Value)->IsMapIterator(): bool(false) -V8\BooleanValue(V8\Value)->IsSetIterator(): bool(false) -V8\BooleanValue(V8\Value)->IsWeakMap(): bool(false) -V8\BooleanValue(V8\Value)->IsWeakSet(): bool(false) -V8\BooleanValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\BooleanValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\BooleanValue(V8\Value)->IsTypedArray(): bool(false) -V8\BooleanValue(V8\Value)->IsUint8Array(): bool(false) -V8\BooleanValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\BooleanValue(V8\Value)->IsInt8Array(): bool(false) -V8\BooleanValue(V8\Value)->IsUint16Array(): bool(false) -V8\BooleanValue(V8\Value)->IsInt16Array(): bool(false) -V8\BooleanValue(V8\Value)->IsUint32Array(): bool(false) -V8\BooleanValue(V8\Value)->IsInt32Array(): bool(false) -V8\BooleanValue(V8\Value)->IsFloat32Array(): bool(false) -V8\BooleanValue(V8\Value)->IsFloat64Array(): bool(false) -V8\BooleanValue(V8\Value)->IsDataView(): bool(false) -V8\BooleanValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\BooleanValue(V8\Value)->IsProxy(): bool(false) +V8\BooleanValue(V8\Value)->typeOf(): V8\StringValue->value(): string(7) "boolean" + +V8\BooleanValue(V8\Value)->isUndefined(): bool(false) +V8\BooleanValue(V8\Value)->isNull(): bool(false) +V8\BooleanValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\BooleanValue(V8\Value)->isTrue(): bool(true) +V8\BooleanValue(V8\Value)->isFalse(): bool(false) +V8\BooleanValue(V8\Value)->isName(): bool(false) +V8\BooleanValue(V8\Value)->isString(): bool(false) +V8\BooleanValue(V8\Value)->isSymbol(): bool(false) +V8\BooleanValue(V8\Value)->isFunction(): bool(false) +V8\BooleanValue(V8\Value)->isArray(): bool(false) +V8\BooleanValue(V8\Value)->isObject(): bool(false) +V8\BooleanValue(V8\Value)->isBoolean(): bool(true) +V8\BooleanValue(V8\Value)->isNumber(): bool(false) +V8\BooleanValue(V8\Value)->isInt32(): bool(false) +V8\BooleanValue(V8\Value)->isUint32(): bool(false) +V8\BooleanValue(V8\Value)->isDate(): bool(false) +V8\BooleanValue(V8\Value)->isArgumentsObject(): bool(false) +V8\BooleanValue(V8\Value)->isBooleanObject(): bool(false) +V8\BooleanValue(V8\Value)->isNumberObject(): bool(false) +V8\BooleanValue(V8\Value)->isStringObject(): bool(false) +V8\BooleanValue(V8\Value)->isSymbolObject(): bool(false) +V8\BooleanValue(V8\Value)->isNativeError(): bool(false) +V8\BooleanValue(V8\Value)->isRegExp(): bool(false) +V8\BooleanValue(V8\Value)->isAsyncFunction(): bool(false) +V8\BooleanValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\BooleanValue(V8\Value)->isGeneratorObject(): bool(false) +V8\BooleanValue(V8\Value)->isPromise(): bool(false) +V8\BooleanValue(V8\Value)->isMap(): bool(false) +V8\BooleanValue(V8\Value)->isSet(): bool(false) +V8\BooleanValue(V8\Value)->isMapIterator(): bool(false) +V8\BooleanValue(V8\Value)->isSetIterator(): bool(false) +V8\BooleanValue(V8\Value)->isWeakMap(): bool(false) +V8\BooleanValue(V8\Value)->isWeakSet(): bool(false) +V8\BooleanValue(V8\Value)->isArrayBuffer(): bool(false) +V8\BooleanValue(V8\Value)->isArrayBufferView(): bool(false) +V8\BooleanValue(V8\Value)->isTypedArray(): bool(false) +V8\BooleanValue(V8\Value)->isUint8Array(): bool(false) +V8\BooleanValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\BooleanValue(V8\Value)->isInt8Array(): bool(false) +V8\BooleanValue(V8\Value)->isUint16Array(): bool(false) +V8\BooleanValue(V8\Value)->isInt16Array(): bool(false) +V8\BooleanValue(V8\Value)->isUint32Array(): bool(false) +V8\BooleanValue(V8\Value)->isInt32Array(): bool(false) +V8\BooleanValue(V8\Value)->isFloat32Array(): bool(false) +V8\BooleanValue(V8\Value)->isFloat64Array(): bool(false) +V8\BooleanValue(V8\Value)->isDataView(): bool(false) +V8\BooleanValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\BooleanValue(V8\Value)->isProxy(): bool(false) Primitive converters: --------------------- -V8\BooleanValue(V8\Value)->BooleanValue(): bool(true) -V8\BooleanValue(V8\Value)->NumberValue(): float(1) +V8\BooleanValue(V8\Value)->booleanValue(): bool(true) +V8\BooleanValue(V8\Value)->numberValue(): float(1) -V8\BooleanValue::ToString() converting: +V8\BooleanValue::toString() converting: --------------------------------------- string(4) "true" diff --git a/tests/V8BooleanObject.phpt b/tests/V8BooleanObject.phpt index fd868be..9d449e9 100644 --- a/tests/V8BooleanObject.phpt +++ b/tests/V8BooleanObject.phpt @@ -26,12 +26,12 @@ $helper->line(); $helper->header('Getters'); -$helper->method_export($value, 'ValueOf'); +$helper->method_export($value, 'valueOf'); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'val'), $value); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'val'), $value); $source = ' console.log("val: ", val); @@ -66,63 +66,63 @@ BooleanObject extends ObjectValue: ok Getters: -------- -V8\BooleanObject->ValueOf(): bool(true) +V8\BooleanObject->valueOf(): bool(true) Checkers: --------- -V8\BooleanObject(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\BooleanObject(V8\ObjectValue)->IsCallable(): bool(false) -V8\BooleanObject(V8\ObjectValue)->IsConstructor(): bool(false) -V8\BooleanObject(V8\Value)->IsUndefined(): bool(false) -V8\BooleanObject(V8\Value)->IsNull(): bool(false) -V8\BooleanObject(V8\Value)->IsNullOrUndefined(): bool(false) -V8\BooleanObject(V8\Value)->IsTrue(): bool(false) -V8\BooleanObject(V8\Value)->IsFalse(): bool(false) -V8\BooleanObject(V8\Value)->IsName(): bool(false) -V8\BooleanObject(V8\Value)->IsString(): bool(false) -V8\BooleanObject(V8\Value)->IsSymbol(): bool(false) -V8\BooleanObject(V8\Value)->IsFunction(): bool(false) -V8\BooleanObject(V8\Value)->IsArray(): bool(false) -V8\BooleanObject(V8\Value)->IsObject(): bool(true) -V8\BooleanObject(V8\Value)->IsBoolean(): bool(false) -V8\BooleanObject(V8\Value)->IsNumber(): bool(false) -V8\BooleanObject(V8\Value)->IsInt32(): bool(false) -V8\BooleanObject(V8\Value)->IsUint32(): bool(false) -V8\BooleanObject(V8\Value)->IsDate(): bool(false) -V8\BooleanObject(V8\Value)->IsArgumentsObject(): bool(false) -V8\BooleanObject(V8\Value)->IsBooleanObject(): bool(true) -V8\BooleanObject(V8\Value)->IsNumberObject(): bool(false) -V8\BooleanObject(V8\Value)->IsStringObject(): bool(false) -V8\BooleanObject(V8\Value)->IsSymbolObject(): bool(false) -V8\BooleanObject(V8\Value)->IsNativeError(): bool(false) -V8\BooleanObject(V8\Value)->IsRegExp(): bool(false) -V8\BooleanObject(V8\Value)->IsAsyncFunction(): bool(false) -V8\BooleanObject(V8\Value)->IsGeneratorFunction(): bool(false) -V8\BooleanObject(V8\Value)->IsGeneratorObject(): bool(false) -V8\BooleanObject(V8\Value)->IsPromise(): bool(false) -V8\BooleanObject(V8\Value)->IsMap(): bool(false) -V8\BooleanObject(V8\Value)->IsSet(): bool(false) -V8\BooleanObject(V8\Value)->IsMapIterator(): bool(false) -V8\BooleanObject(V8\Value)->IsSetIterator(): bool(false) -V8\BooleanObject(V8\Value)->IsWeakMap(): bool(false) -V8\BooleanObject(V8\Value)->IsWeakSet(): bool(false) -V8\BooleanObject(V8\Value)->IsArrayBuffer(): bool(false) -V8\BooleanObject(V8\Value)->IsArrayBufferView(): bool(false) -V8\BooleanObject(V8\Value)->IsTypedArray(): bool(false) -V8\BooleanObject(V8\Value)->IsUint8Array(): bool(false) -V8\BooleanObject(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\BooleanObject(V8\Value)->IsInt8Array(): bool(false) -V8\BooleanObject(V8\Value)->IsUint16Array(): bool(false) -V8\BooleanObject(V8\Value)->IsInt16Array(): bool(false) -V8\BooleanObject(V8\Value)->IsUint32Array(): bool(false) -V8\BooleanObject(V8\Value)->IsInt32Array(): bool(false) -V8\BooleanObject(V8\Value)->IsFloat32Array(): bool(false) -V8\BooleanObject(V8\Value)->IsFloat64Array(): bool(false) -V8\BooleanObject(V8\Value)->IsDataView(): bool(false) -V8\BooleanObject(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\BooleanObject(V8\Value)->IsProxy(): bool(false) +V8\BooleanObject(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\BooleanObject(V8\ObjectValue)->isCallable(): bool(false) +V8\BooleanObject(V8\ObjectValue)->isConstructor(): bool(false) +V8\BooleanObject(V8\Value)->isUndefined(): bool(false) +V8\BooleanObject(V8\Value)->isNull(): bool(false) +V8\BooleanObject(V8\Value)->isNullOrUndefined(): bool(false) +V8\BooleanObject(V8\Value)->isTrue(): bool(false) +V8\BooleanObject(V8\Value)->isFalse(): bool(false) +V8\BooleanObject(V8\Value)->isName(): bool(false) +V8\BooleanObject(V8\Value)->isString(): bool(false) +V8\BooleanObject(V8\Value)->isSymbol(): bool(false) +V8\BooleanObject(V8\Value)->isFunction(): bool(false) +V8\BooleanObject(V8\Value)->isArray(): bool(false) +V8\BooleanObject(V8\Value)->isObject(): bool(true) +V8\BooleanObject(V8\Value)->isBoolean(): bool(false) +V8\BooleanObject(V8\Value)->isNumber(): bool(false) +V8\BooleanObject(V8\Value)->isInt32(): bool(false) +V8\BooleanObject(V8\Value)->isUint32(): bool(false) +V8\BooleanObject(V8\Value)->isDate(): bool(false) +V8\BooleanObject(V8\Value)->isArgumentsObject(): bool(false) +V8\BooleanObject(V8\Value)->isBooleanObject(): bool(true) +V8\BooleanObject(V8\Value)->isNumberObject(): bool(false) +V8\BooleanObject(V8\Value)->isStringObject(): bool(false) +V8\BooleanObject(V8\Value)->isSymbolObject(): bool(false) +V8\BooleanObject(V8\Value)->isNativeError(): bool(false) +V8\BooleanObject(V8\Value)->isRegExp(): bool(false) +V8\BooleanObject(V8\Value)->isAsyncFunction(): bool(false) +V8\BooleanObject(V8\Value)->isGeneratorFunction(): bool(false) +V8\BooleanObject(V8\Value)->isGeneratorObject(): bool(false) +V8\BooleanObject(V8\Value)->isPromise(): bool(false) +V8\BooleanObject(V8\Value)->isMap(): bool(false) +V8\BooleanObject(V8\Value)->isSet(): bool(false) +V8\BooleanObject(V8\Value)->isMapIterator(): bool(false) +V8\BooleanObject(V8\Value)->isSetIterator(): bool(false) +V8\BooleanObject(V8\Value)->isWeakMap(): bool(false) +V8\BooleanObject(V8\Value)->isWeakSet(): bool(false) +V8\BooleanObject(V8\Value)->isArrayBuffer(): bool(false) +V8\BooleanObject(V8\Value)->isArrayBufferView(): bool(false) +V8\BooleanObject(V8\Value)->isTypedArray(): bool(false) +V8\BooleanObject(V8\Value)->isUint8Array(): bool(false) +V8\BooleanObject(V8\Value)->isUint8ClampedArray(): bool(false) +V8\BooleanObject(V8\Value)->isInt8Array(): bool(false) +V8\BooleanObject(V8\Value)->isUint16Array(): bool(false) +V8\BooleanObject(V8\Value)->isInt16Array(): bool(false) +V8\BooleanObject(V8\Value)->isUint32Array(): bool(false) +V8\BooleanObject(V8\Value)->isInt32Array(): bool(false) +V8\BooleanObject(V8\Value)->isFloat32Array(): bool(false) +V8\BooleanObject(V8\Value)->isFloat64Array(): bool(false) +V8\BooleanObject(V8\Value)->isDataView(): bool(false) +V8\BooleanObject(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\BooleanObject(V8\Value)->isProxy(): bool(false) val: true @@ -131,55 +131,55 @@ typeof val: object Checkers on boxed from script: ------------------------------ -V8\BooleanObject(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\BooleanObject(V8\ObjectValue)->IsCallable(): bool(false) -V8\BooleanObject(V8\ObjectValue)->IsConstructor(): bool(false) -V8\BooleanObject(V8\Value)->IsUndefined(): bool(false) -V8\BooleanObject(V8\Value)->IsNull(): bool(false) -V8\BooleanObject(V8\Value)->IsNullOrUndefined(): bool(false) -V8\BooleanObject(V8\Value)->IsTrue(): bool(false) -V8\BooleanObject(V8\Value)->IsFalse(): bool(false) -V8\BooleanObject(V8\Value)->IsName(): bool(false) -V8\BooleanObject(V8\Value)->IsString(): bool(false) -V8\BooleanObject(V8\Value)->IsSymbol(): bool(false) -V8\BooleanObject(V8\Value)->IsFunction(): bool(false) -V8\BooleanObject(V8\Value)->IsArray(): bool(false) -V8\BooleanObject(V8\Value)->IsObject(): bool(true) -V8\BooleanObject(V8\Value)->IsBoolean(): bool(false) -V8\BooleanObject(V8\Value)->IsNumber(): bool(false) -V8\BooleanObject(V8\Value)->IsInt32(): bool(false) -V8\BooleanObject(V8\Value)->IsUint32(): bool(false) -V8\BooleanObject(V8\Value)->IsDate(): bool(false) -V8\BooleanObject(V8\Value)->IsArgumentsObject(): bool(false) -V8\BooleanObject(V8\Value)->IsBooleanObject(): bool(true) -V8\BooleanObject(V8\Value)->IsNumberObject(): bool(false) -V8\BooleanObject(V8\Value)->IsStringObject(): bool(false) -V8\BooleanObject(V8\Value)->IsSymbolObject(): bool(false) -V8\BooleanObject(V8\Value)->IsNativeError(): bool(false) -V8\BooleanObject(V8\Value)->IsRegExp(): bool(false) -V8\BooleanObject(V8\Value)->IsAsyncFunction(): bool(false) -V8\BooleanObject(V8\Value)->IsGeneratorFunction(): bool(false) -V8\BooleanObject(V8\Value)->IsGeneratorObject(): bool(false) -V8\BooleanObject(V8\Value)->IsPromise(): bool(false) -V8\BooleanObject(V8\Value)->IsMap(): bool(false) -V8\BooleanObject(V8\Value)->IsSet(): bool(false) -V8\BooleanObject(V8\Value)->IsMapIterator(): bool(false) -V8\BooleanObject(V8\Value)->IsSetIterator(): bool(false) -V8\BooleanObject(V8\Value)->IsWeakMap(): bool(false) -V8\BooleanObject(V8\Value)->IsWeakSet(): bool(false) -V8\BooleanObject(V8\Value)->IsArrayBuffer(): bool(false) -V8\BooleanObject(V8\Value)->IsArrayBufferView(): bool(false) -V8\BooleanObject(V8\Value)->IsTypedArray(): bool(false) -V8\BooleanObject(V8\Value)->IsUint8Array(): bool(false) -V8\BooleanObject(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\BooleanObject(V8\Value)->IsInt8Array(): bool(false) -V8\BooleanObject(V8\Value)->IsUint16Array(): bool(false) -V8\BooleanObject(V8\Value)->IsInt16Array(): bool(false) -V8\BooleanObject(V8\Value)->IsUint32Array(): bool(false) -V8\BooleanObject(V8\Value)->IsInt32Array(): bool(false) -V8\BooleanObject(V8\Value)->IsFloat32Array(): bool(false) -V8\BooleanObject(V8\Value)->IsFloat64Array(): bool(false) -V8\BooleanObject(V8\Value)->IsDataView(): bool(false) -V8\BooleanObject(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\BooleanObject(V8\Value)->IsProxy(): bool(false) +V8\BooleanObject(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\BooleanObject(V8\ObjectValue)->isCallable(): bool(false) +V8\BooleanObject(V8\ObjectValue)->isConstructor(): bool(false) +V8\BooleanObject(V8\Value)->isUndefined(): bool(false) +V8\BooleanObject(V8\Value)->isNull(): bool(false) +V8\BooleanObject(V8\Value)->isNullOrUndefined(): bool(false) +V8\BooleanObject(V8\Value)->isTrue(): bool(false) +V8\BooleanObject(V8\Value)->isFalse(): bool(false) +V8\BooleanObject(V8\Value)->isName(): bool(false) +V8\BooleanObject(V8\Value)->isString(): bool(false) +V8\BooleanObject(V8\Value)->isSymbol(): bool(false) +V8\BooleanObject(V8\Value)->isFunction(): bool(false) +V8\BooleanObject(V8\Value)->isArray(): bool(false) +V8\BooleanObject(V8\Value)->isObject(): bool(true) +V8\BooleanObject(V8\Value)->isBoolean(): bool(false) +V8\BooleanObject(V8\Value)->isNumber(): bool(false) +V8\BooleanObject(V8\Value)->isInt32(): bool(false) +V8\BooleanObject(V8\Value)->isUint32(): bool(false) +V8\BooleanObject(V8\Value)->isDate(): bool(false) +V8\BooleanObject(V8\Value)->isArgumentsObject(): bool(false) +V8\BooleanObject(V8\Value)->isBooleanObject(): bool(true) +V8\BooleanObject(V8\Value)->isNumberObject(): bool(false) +V8\BooleanObject(V8\Value)->isStringObject(): bool(false) +V8\BooleanObject(V8\Value)->isSymbolObject(): bool(false) +V8\BooleanObject(V8\Value)->isNativeError(): bool(false) +V8\BooleanObject(V8\Value)->isRegExp(): bool(false) +V8\BooleanObject(V8\Value)->isAsyncFunction(): bool(false) +V8\BooleanObject(V8\Value)->isGeneratorFunction(): bool(false) +V8\BooleanObject(V8\Value)->isGeneratorObject(): bool(false) +V8\BooleanObject(V8\Value)->isPromise(): bool(false) +V8\BooleanObject(V8\Value)->isMap(): bool(false) +V8\BooleanObject(V8\Value)->isSet(): bool(false) +V8\BooleanObject(V8\Value)->isMapIterator(): bool(false) +V8\BooleanObject(V8\Value)->isSetIterator(): bool(false) +V8\BooleanObject(V8\Value)->isWeakMap(): bool(false) +V8\BooleanObject(V8\Value)->isWeakSet(): bool(false) +V8\BooleanObject(V8\Value)->isArrayBuffer(): bool(false) +V8\BooleanObject(V8\Value)->isArrayBufferView(): bool(false) +V8\BooleanObject(V8\Value)->isTypedArray(): bool(false) +V8\BooleanObject(V8\Value)->isUint8Array(): bool(false) +V8\BooleanObject(V8\Value)->isUint8ClampedArray(): bool(false) +V8\BooleanObject(V8\Value)->isInt8Array(): bool(false) +V8\BooleanObject(V8\Value)->isUint16Array(): bool(false) +V8\BooleanObject(V8\Value)->isInt16Array(): bool(false) +V8\BooleanObject(V8\Value)->isUint32Array(): bool(false) +V8\BooleanObject(V8\Value)->isInt32Array(): bool(false) +V8\BooleanObject(V8\Value)->isFloat32Array(): bool(false) +V8\BooleanObject(V8\Value)->isFloat64Array(): bool(false) +V8\BooleanObject(V8\Value)->isDataView(): bool(false) +V8\BooleanObject(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\BooleanObject(V8\Value)->isProxy(): bool(false) diff --git a/tests/V8CachedData.phpt b/tests/V8CachedData.phpt index 474e06a..e12a5d1 100644 --- a/tests/V8CachedData.phpt +++ b/tests/V8CachedData.phpt @@ -33,10 +33,10 @@ $data = [ foreach ($data as $d) { $value = new \V8\ScriptCompiler\CachedData($d); - $helper->method_matches_with_dump($value, 'GetData', $d); + $helper->method_matches_with_dump($value, 'getData', $d); } -$helper->method_dump($value, 'IsRejected'); +$helper->method_dump($value, 'isRejected'); @@ -50,11 +50,11 @@ object(V8\ScriptCompiler\CachedData)#3 (0) { Methods: -------- -V8\ScriptCompiler\CachedData::GetData() matches expected string(0) "" -V8\ScriptCompiler\CachedData::GetData() matches expected string(16) "test foo bar baz" -V8\ScriptCompiler\CachedData::GetData() matches expected string(16) "%r.{16}%r" -V8\ScriptCompiler\CachedData::GetData() matches expected string(31) "%r.{31}%r" -V8\ScriptCompiler\CachedData::GetData() matches expected string(12) "Юникод" -V8\ScriptCompiler\CachedData::GetData() matches expected string(45) "萬國碼、國際碼、統一碼、單一碼" -V8\ScriptCompiler\CachedData::GetData() matches expected string(16) "یوونیکۆد" -V8\ScriptCompiler\CachedData::IsRejected() false +V8\ScriptCompiler\CachedData::getData() matches expected string(0) "" +V8\ScriptCompiler\CachedData::getData() matches expected string(16) "test foo bar baz" +V8\ScriptCompiler\CachedData::getData() matches expected string(16) "%r.{16}%r" +V8\ScriptCompiler\CachedData::getData() matches expected string(31) "%r.{31}%r" +V8\ScriptCompiler\CachedData::getData() matches expected string(12) "Юникод" +V8\ScriptCompiler\CachedData::getData() matches expected string(45) "萬國碼、國際碼、統一碼、單一碼" +V8\ScriptCompiler\CachedData::getData() matches expected string(16) "یوونیکۆد" +V8\ScriptCompiler\CachedData::isRejected() false diff --git a/tests/V8Context.phpt b/tests/V8Context.phpt index 80785cd..20a8cdd 100644 --- a/tests/V8Context.phpt +++ b/tests/V8Context.phpt @@ -15,35 +15,35 @@ $isolate = new \V8\Isolate(); $context = new \V8\Context($isolate); -$helper->method_matches_instanceof($context, 'GlobalObject', \V8\ObjectValue::class); +$helper->method_matches_instanceof($context, 'globalObject', \V8\ObjectValue::class); -$global = $context->GlobalObject(); +$global = $context->globalObject(); -$v8_helper->CHECK($global->SameValue($context->GlobalObject()), '$global->SameValue($context->GlobalObject())'); +$v8_helper->CHECK($global->sameValue($context->globalObject()), '$global->sameValue($context->globalObject())'); -$helper->method_matches($context, 'IsCodeGenerationFromStringsAllowed', true); +$helper->method_matches($context, 'isCodeGenerationFromStringsAllowed', true); $v8_helper->CompileTryRun($context, 'eval("1+1")'); -$helper->assert('Code generation allowed', $context->IsCodeGenerationFromStringsAllowed() === true); +$helper->assert('Code generation allowed', $context->isCodeGenerationFromStringsAllowed() === true); -$context->AllowCodeGenerationFromStrings(false); +$context->allowCodeGenerationFromStrings(false); -$helper->assert('Code generation is not allowed', $context->IsCodeGenerationFromStringsAllowed() === false); +$helper->assert('Code generation is not allowed', $context->isCodeGenerationFromStringsAllowed() === false); -$helper->method_matches_with_output($context, 'IsCodeGenerationFromStringsAllowed', false); +$helper->method_matches_with_output($context, 'isCodeGenerationFromStringsAllowed', false); $res = $v8_helper->CompileTryRun($context, 'eval("1+1")'); -$context->SetErrorMessageForCodeGenerationFromStrings(new \V8\StringValue($isolate, 'Whoa! Nope. No eval this time, sorry.')); +$context->setErrorMessageForCodeGenerationFromStrings(new \V8\StringValue($isolate, 'Whoa! Nope. No eval this time, sorry.')); $res = $v8_helper->CompileTryRun($context, 'eval("2+2")'); ?> --EXPECT-- -V8\Context::GlobalObject() result is instance of V8\ObjectValue -CHECK $global->SameValue($context->GlobalObject()): OK -V8\Context::IsCodeGenerationFromStringsAllowed() matches expected value +V8\Context::globalObject() result is instance of V8\ObjectValue +CHECK $global->sameValue($context->globalObject()): OK +V8\Context::isCodeGenerationFromStringsAllowed() matches expected value Code generation allowed: ok Code generation is not allowed: ok -V8\Context::IsCodeGenerationFromStringsAllowed() matches expected false +V8\Context::isCodeGenerationFromStringsAllowed() matches expected false eval("1+1"): V8\Exceptions\TryCatchException: EvalError: Code generation from strings disallowed for this context eval("2+2"): V8\Exceptions\TryCatchException: EvalError: Whoa! Nope. No eval this time, sorry. diff --git a/tests/V8Context_GlobalObject.phpt b/tests/V8Context_globalObject.phpt similarity index 72% rename from tests/V8Context_GlobalObject.phpt rename to tests/V8Context_globalObject.phpt index b68652d..db66a92 100644 --- a/tests/V8Context_GlobalObject.phpt +++ b/tests/V8Context_globalObject.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\Context::GlobalObject() +V8\Context::globalObject() --SKIPIF-- --FILE-- @@ -17,20 +17,20 @@ require '.tracking_dtors.php'; $isolate = new \V8\Isolate(); $context = new \V8\Context($isolate); -$helper->method_matches_instanceof($context, 'GlobalObject', \V8\ObjectValue::class); +$helper->method_matches_instanceof($context, 'globalObject', \V8\ObjectValue::class); -$global1 = $context->GlobalObject(); +$global1 = $context->globalObject(); $global1->foo = 'bar'; -$global2 = $context->GlobalObject(); +$global2 = $context->globalObject(); $helper->assert('Global object on repeatable calls is the same', $global1 === $global2); $helper->assert('Global object on repeatable calls holds extra props', $global1->foo === $global2->foo && $global2->foo === 'bar'); -$context->DetachGlobal(); +$context->detachGlobal(); $context2 = new \V8\Context($isolate, null, $global2); -$helper->method_matches_instanceof($context2, 'GlobalObject', \V8\ObjectValue::class); +$helper->method_matches_instanceof($context2, 'globalObject', \V8\ObjectValue::class); echo 'Global object passed from one context to another is ', ($global1 === $global2 ? 'the same' : 'not the same'), PHP_EOL; @@ -38,8 +38,8 @@ echo 'Global object passed from one context to another is ', ($global1 === $glob ?> --EXPECT-- -V8\Context::GlobalObject() result is instance of V8\ObjectValue +V8\Context::globalObject() result is instance of V8\ObjectValue Global object on repeatable calls is the same: ok Global object on repeatable calls holds extra props: ok -V8\Context::GlobalObject() result is instance of V8\ObjectValue +V8\Context::globalObject() result is instance of V8\ObjectValue Global object passed from one context to another is the same diff --git a/tests/V8Context_reference_lifecycle.phpt b/tests/V8Context_reference_lifecycle.phpt index 27ccb15..5df1889 100644 --- a/tests/V8Context_reference_lifecycle.phpt +++ b/tests/V8Context_reference_lifecycle.phpt @@ -21,11 +21,11 @@ $isolate = new \V8\Isolate(); $obj = $v8_helper->CompileRun(new \v8Tests\TrackingDtors\Context($isolate), 'var obj = {}; obj'); //$helper->dump($obj); -$helper->dump($obj->GetContext()); +$helper->dump($obj->getContext()); $context = new \v8Tests\TrackingDtors\Context($isolate); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'obj'), $obj); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'obj'), $obj); $helper->line(); $obj = null; @@ -37,7 +37,7 @@ $helper->line(); $obj = $v8_helper->CompileRun($context, 'var obj2 = obj; obj2'); //$helper->dump($obj); -$helper->dump($obj->GetContext()); +$helper->dump($obj->getContext()); $obj = null; ?> --EXPECT-- diff --git a/tests/V8Context_SetSecurityToken.phpt b/tests/V8Context_setSecurityToken.phpt similarity index 65% rename from tests/V8Context_SetSecurityToken.phpt rename to tests/V8Context_setSecurityToken.phpt index b313eef..ab78d51 100644 --- a/tests/V8Context_SetSecurityToken.phpt +++ b/tests/V8Context_setSecurityToken.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\Context::SetSecurityToken() +V8\Context::setSecurityToken() --SKIPIF-- --FILE-- @@ -20,38 +20,38 @@ $other = new \V8\Context($isolate); $v8_helper->injectConsoleLog($other); $obj_own = new \V8\ObjectValue($context); -$obj_own->Set($context, new \V8\StringValue($isolate, 'test'), new \V8\StringValue($isolate, 'own')); +$obj_own->set($context, new \V8\StringValue($isolate, 'test'), new \V8\StringValue($isolate, 'own')); $obj_other = new \V8\ObjectValue($context); -$obj_other->Set($context, new \V8\StringValue($isolate, 'test'), new \V8\StringValue($isolate, 'other')); +$obj_other->set($context, new \V8\StringValue($isolate, 'test'), new \V8\StringValue($isolate, 'other')); try { - $context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'own'), $obj_own); - $context->GlobalObject()->Set($other, new \V8\StringValue($isolate, 'other'), $obj_other); + $context->globalObject()->set($context, new \V8\StringValue($isolate, 'own'), $obj_own); + $context->globalObject()->set($other, new \V8\StringValue($isolate, 'other'), $obj_other); $helper->assert('There is no cross-context access by default', false); } catch (\V8\Exceptions\TryCatchException $e) { $helper->exception_export($e); } -$context->SetSecurityToken(new \V8\StringValue($isolate, 'secret 1')); -$other->SetSecurityToken(new \V8\StringValue($isolate, 'secret 2')); +$context->setSecurityToken(new \V8\StringValue($isolate, 'secret 1')); +$other->setSecurityToken(new \V8\StringValue($isolate, 'secret 2')); try { - $context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'own'), $obj_own); - $context->GlobalObject()->Set($other, new \V8\StringValue($isolate, 'other'), $obj_other); + $context->globalObject()->set($context, new \V8\StringValue($isolate, 'own'), $obj_own); + $context->globalObject()->set($other, new \V8\StringValue($isolate, 'other'), $obj_other); $helper->assert('Different security tokens should not grant cross-context access', false); } catch (\V8\Exceptions\TryCatchException $e) { $helper->exception_export($e); } -$context->SetSecurityToken(new \V8\StringValue($isolate, 'secret')); -$other->SetSecurityToken(new \V8\StringValue($isolate, 'secret')); +$context->setSecurityToken(new \V8\StringValue($isolate, 'secret')); +$other->setSecurityToken(new \V8\StringValue($isolate, 'secret')); try { - $context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'own'), $obj_own); - $context->GlobalObject()->Set($other, new \V8\StringValue($isolate, 'other'), $obj_other); + $context->globalObject()->set($context, new \V8\StringValue($isolate, 'own'), $obj_own); + $context->globalObject()->set($other, new \V8\StringValue($isolate, 'other'), $obj_other); $helper->assert('Different security tokens with the same value should not grant cross-context access', false); } catch (\V8\Exceptions\TryCatchException $e) { $helper->exception_export($e); @@ -60,11 +60,11 @@ try { $secret = new \V8\StringValue($isolate, 'secret'); -$context->SetSecurityToken($secret); -$other->SetSecurityToken($secret); +$context->setSecurityToken($secret); +$other->setSecurityToken($secret); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'own'), $obj_own); -$context->GlobalObject()->Set($other, new \V8\StringValue($isolate, 'other'), $obj_other); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'own'), $obj_own); +$context->globalObject()->set($other, new \V8\StringValue($isolate, 'other'), $obj_other); $helper->line(); diff --git a/tests/V8Context_weakness.phpt b/tests/V8Context_weakness.phpt index 33a66b4..9081f3f 100644 --- a/tests/V8Context_weakness.phpt +++ b/tests/V8Context_weakness.phpt @@ -27,7 +27,7 @@ $script = new \V8\Script( ); -$obj = $script->Run($script->GetContext())->ToObject($script->GetContext()); // contest should be stored in object +$obj = $script->run($script->getContext())->toObject($script->getContext()); // contest should be stored in object $script = null; diff --git a/tests/V8DateObject.phpt b/tests/V8DateObject.phpt index c066e77..72aa663 100644 --- a/tests/V8DateObject.phpt +++ b/tests/V8DateObject.phpt @@ -29,15 +29,15 @@ $helper->dump($value); $helper->space(); $helper->assert('DateObject extends ObjectValue', $value instanceof \V8\ObjectValue); -$helper->assert('ObjectValue is instanceof Date', $value->InstanceOf($context, $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'Date'))));$helper->line(); +$helper->assert('ObjectValue is instanceof Date', $value->instanceOf($context, $context->globalObject()->get($context, new \V8\StringValue($isolate, 'Date'))));$helper->line(); $helper->header('Getters'); -$helper->method_export($value, 'ValueOf'); +$helper->method_export($value, 'valueOf'); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'val'), $value); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'val'), $value); $source = ' var orig = val; @@ -48,7 +48,7 @@ orig $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context); +$res = $script->run($context); $helper->space(); $helper->header('Returned value should be the same'); @@ -62,10 +62,10 @@ $helper->header('Timezone change (with notification to v8)'); $old_tz = getenv('TZ'); putenv('TZ=America/Los_Angeles'); // UTC offset DST (ISO 8601)‎: ‎−07:00, UTC offset (ISO 8601)‎: ‎−08:00 -\V8\DateObject::DateTimeConfigurationChangeNotification($isolate); +\V8\DateObject::dateTimeConfigurationChangeNotification($isolate); $value = new V8\DateObject($context, $test_time); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'val'), $value); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'val'), $value); $source = ' console.log("val: ", val); @@ -76,8 +76,8 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context); -$helper->value_matches($test_time, $value->ValueOf()); +$res = $script->run($context); +$helper->value_matches($test_time, $value->valueOf()); $helper->space(); @@ -86,7 +86,7 @@ $helper->header('Timezone change (without notification to v8)'); putenv('TZ=America/New_York'); // UTC offset DST (ISO 8601)‎: ‎−05:00, UTC offset (ISO 8601)‎: ‎−04:00 $value = new V8\DateObject($context, $test_time); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'val'), $value); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'val'), $value); $source = ' console.log("val: ", val); @@ -97,11 +97,11 @@ $file_name = 'test.js'; // TODO: for some reason v8 still be notified about TZ changes, see https://groups.google.com/forum/?fromgroups#!topic/v8-users/f249jR67ANk // We temporary set EDT instead of PDT which was before, this should lead to no error, but the output date value is -// undefined, it's a must to invoke \V8\DateObject::DateTimeConfigurationChangeNotification($isolate); as we did before. +// undefined, it's a must to invoke \V8\DateObject::dateTimeConfigurationChangeNotification($isolate); as we did before. // This case is verify that no segfault or exception thrown and to demonstrate that result is not what you expect to get. $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context); -$helper->value_matches($test_time, $value->ValueOf()); +$res = $script->run($context); +$helper->value_matches($test_time, $value->valueOf()); $helper->space(); putenv("TZ={$old_tz}"); // Go back @@ -129,63 +129,63 @@ ObjectValue is instanceof Date: ok Getters: -------- -V8\DateObject->ValueOf(): float(1445444940000) +V8\DateObject->valueOf(): float(1445444940000) Checkers: --------- -V8\DateObject(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\DateObject(V8\ObjectValue)->IsCallable(): bool(false) -V8\DateObject(V8\ObjectValue)->IsConstructor(): bool(false) -V8\DateObject(V8\Value)->IsUndefined(): bool(false) -V8\DateObject(V8\Value)->IsNull(): bool(false) -V8\DateObject(V8\Value)->IsNullOrUndefined(): bool(false) -V8\DateObject(V8\Value)->IsTrue(): bool(false) -V8\DateObject(V8\Value)->IsFalse(): bool(false) -V8\DateObject(V8\Value)->IsName(): bool(false) -V8\DateObject(V8\Value)->IsString(): bool(false) -V8\DateObject(V8\Value)->IsSymbol(): bool(false) -V8\DateObject(V8\Value)->IsFunction(): bool(false) -V8\DateObject(V8\Value)->IsArray(): bool(false) -V8\DateObject(V8\Value)->IsObject(): bool(true) -V8\DateObject(V8\Value)->IsBoolean(): bool(false) -V8\DateObject(V8\Value)->IsNumber(): bool(false) -V8\DateObject(V8\Value)->IsInt32(): bool(false) -V8\DateObject(V8\Value)->IsUint32(): bool(false) -V8\DateObject(V8\Value)->IsDate(): bool(true) -V8\DateObject(V8\Value)->IsArgumentsObject(): bool(false) -V8\DateObject(V8\Value)->IsBooleanObject(): bool(false) -V8\DateObject(V8\Value)->IsNumberObject(): bool(false) -V8\DateObject(V8\Value)->IsStringObject(): bool(false) -V8\DateObject(V8\Value)->IsSymbolObject(): bool(false) -V8\DateObject(V8\Value)->IsNativeError(): bool(false) -V8\DateObject(V8\Value)->IsRegExp(): bool(false) -V8\DateObject(V8\Value)->IsAsyncFunction(): bool(false) -V8\DateObject(V8\Value)->IsGeneratorFunction(): bool(false) -V8\DateObject(V8\Value)->IsGeneratorObject(): bool(false) -V8\DateObject(V8\Value)->IsPromise(): bool(false) -V8\DateObject(V8\Value)->IsMap(): bool(false) -V8\DateObject(V8\Value)->IsSet(): bool(false) -V8\DateObject(V8\Value)->IsMapIterator(): bool(false) -V8\DateObject(V8\Value)->IsSetIterator(): bool(false) -V8\DateObject(V8\Value)->IsWeakMap(): bool(false) -V8\DateObject(V8\Value)->IsWeakSet(): bool(false) -V8\DateObject(V8\Value)->IsArrayBuffer(): bool(false) -V8\DateObject(V8\Value)->IsArrayBufferView(): bool(false) -V8\DateObject(V8\Value)->IsTypedArray(): bool(false) -V8\DateObject(V8\Value)->IsUint8Array(): bool(false) -V8\DateObject(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\DateObject(V8\Value)->IsInt8Array(): bool(false) -V8\DateObject(V8\Value)->IsUint16Array(): bool(false) -V8\DateObject(V8\Value)->IsInt16Array(): bool(false) -V8\DateObject(V8\Value)->IsUint32Array(): bool(false) -V8\DateObject(V8\Value)->IsInt32Array(): bool(false) -V8\DateObject(V8\Value)->IsFloat32Array(): bool(false) -V8\DateObject(V8\Value)->IsFloat64Array(): bool(false) -V8\DateObject(V8\Value)->IsDataView(): bool(false) -V8\DateObject(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\DateObject(V8\Value)->IsProxy(): bool(false) +V8\DateObject(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\DateObject(V8\ObjectValue)->isCallable(): bool(false) +V8\DateObject(V8\ObjectValue)->isConstructor(): bool(false) +V8\DateObject(V8\Value)->isUndefined(): bool(false) +V8\DateObject(V8\Value)->isNull(): bool(false) +V8\DateObject(V8\Value)->isNullOrUndefined(): bool(false) +V8\DateObject(V8\Value)->isTrue(): bool(false) +V8\DateObject(V8\Value)->isFalse(): bool(false) +V8\DateObject(V8\Value)->isName(): bool(false) +V8\DateObject(V8\Value)->isString(): bool(false) +V8\DateObject(V8\Value)->isSymbol(): bool(false) +V8\DateObject(V8\Value)->isFunction(): bool(false) +V8\DateObject(V8\Value)->isArray(): bool(false) +V8\DateObject(V8\Value)->isObject(): bool(true) +V8\DateObject(V8\Value)->isBoolean(): bool(false) +V8\DateObject(V8\Value)->isNumber(): bool(false) +V8\DateObject(V8\Value)->isInt32(): bool(false) +V8\DateObject(V8\Value)->isUint32(): bool(false) +V8\DateObject(V8\Value)->isDate(): bool(true) +V8\DateObject(V8\Value)->isArgumentsObject(): bool(false) +V8\DateObject(V8\Value)->isBooleanObject(): bool(false) +V8\DateObject(V8\Value)->isNumberObject(): bool(false) +V8\DateObject(V8\Value)->isStringObject(): bool(false) +V8\DateObject(V8\Value)->isSymbolObject(): bool(false) +V8\DateObject(V8\Value)->isNativeError(): bool(false) +V8\DateObject(V8\Value)->isRegExp(): bool(false) +V8\DateObject(V8\Value)->isAsyncFunction(): bool(false) +V8\DateObject(V8\Value)->isGeneratorFunction(): bool(false) +V8\DateObject(V8\Value)->isGeneratorObject(): bool(false) +V8\DateObject(V8\Value)->isPromise(): bool(false) +V8\DateObject(V8\Value)->isMap(): bool(false) +V8\DateObject(V8\Value)->isSet(): bool(false) +V8\DateObject(V8\Value)->isMapIterator(): bool(false) +V8\DateObject(V8\Value)->isSetIterator(): bool(false) +V8\DateObject(V8\Value)->isWeakMap(): bool(false) +V8\DateObject(V8\Value)->isWeakSet(): bool(false) +V8\DateObject(V8\Value)->isArrayBuffer(): bool(false) +V8\DateObject(V8\Value)->isArrayBufferView(): bool(false) +V8\DateObject(V8\Value)->isTypedArray(): bool(false) +V8\DateObject(V8\Value)->isUint8Array(): bool(false) +V8\DateObject(V8\Value)->isUint8ClampedArray(): bool(false) +V8\DateObject(V8\Value)->isInt8Array(): bool(false) +V8\DateObject(V8\Value)->isUint16Array(): bool(false) +V8\DateObject(V8\Value)->isInt16Array(): bool(false) +V8\DateObject(V8\Value)->isUint32Array(): bool(false) +V8\DateObject(V8\Value)->isInt32Array(): bool(false) +V8\DateObject(V8\Value)->isFloat32Array(): bool(false) +V8\DateObject(V8\Value)->isFloat64Array(): bool(false) +V8\DateObject(V8\Value)->isDataView(): bool(false) +V8\DateObject(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\DateObject(V8\Value)->isProxy(): bool(false) val: Wed Oct 21 2015 16:29:00 GMT+0000 (UTC) diff --git a/tests/V8Exception_CreateMessage.phpt b/tests/V8Exception_CreateMessage.phpt deleted file mode 100644 index 46f7664..0000000 --- a/tests/V8Exception_CreateMessage.phpt +++ /dev/null @@ -1,219 +0,0 @@ ---TEST-- -V8\Exception::CreateMessage() ---SKIPIF-- - ---FILE-- -assert('Can create message when out of context', $message instanceof \V8\Message); -} catch (\Exception $e) { - $helper->exception_export($e); -} - -$helper->line(); - - -$func_test_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper, $v8_helper) { - - $helper->assert('Exception passed', count($info->Arguments()) == 1); - $helper->line(); - - $exception = $info->Arguments()[0]; - - $message = V8\Exception::CreateMessage($info->GetContext(), $exception); - $helper->header('Message created from thrown value'); - $helper->dump_object_methods($message); - $helper->line(); - - $exception = new \V8\StringValue($info->GetIsolate(), 'test'); - $message = V8\Exception::CreateMessage($info->GetContext(), $exception); - $helper->header('Message created from created value'); - $helper->dump_object_methods($message); - $helper->line(); -}); - -$global_tpl = new \V8\ObjectTemplate($isolate); -$global_tpl->Set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); - -$context = new \V8\Context($isolate, $global_tpl); -$v8_helper->injectConsoleLog($context); - - -$source = ' - var ex; - - try { - throw {test: "error"}; - } catch (exception) { - console.log("exception: ", "\'", exception, "\'"); - console.log("exception.stack: ", exception.stack); - console.log(""); - - test(exception); - - ex = exception; - } - - ex -'; - -$res = $v8_helper->CompileRun($context, $source); -$helper->line(); - -$v8_helper->run_checks($res); - -// EXPECTF: ---/\["script_id":"V8\\ScriptOrigin":private\]=>\n int\(\d+\)/ -// EXPECTF: +++["script_id":"V8\ScriptOrigin":private]=>\n int(%d) -?> -EOF ---EXPECTF-- -Can create message when out of context: ok - -exception: '[object Object]' -exception.stack: - -Exception passed: ok - -Message created from thrown value: ----------------------------------- -V8\Message->Get(): string(18) "Uncaught #" -V8\Message->GetSourceLine(): string(24) " test(exception);" -V8\Message->GetScriptOrigin(): - object(V8\ScriptOrigin)#15 (6) { - ["resource_name":"V8\ScriptOrigin":private]=> - string(7) "test.js" - ["resource_line_offset":"V8\ScriptOrigin":private]=> - int(0) - ["resource_column_offset":"V8\ScriptOrigin":private]=> - int(0) - ["options":"V8\ScriptOrigin":private]=> - object(V8\ScriptOriginOptions)#13 (4) { - ["is_shared_cross_origin":"V8\ScriptOriginOptions":private]=> - bool(false) - ["is_opaque":"V8\ScriptOriginOptions":private]=> - bool(false) - ["is_wasm":"V8\ScriptOriginOptions":private]=> - bool(false) - ["is_module":"V8\ScriptOriginOptions":private]=> - bool(false) - } - ["script_id":"V8\ScriptOrigin":private]=> - int(%d) - ["source_map_url":"V8\ScriptOrigin":private]=> - string(0) "" - } -V8\Message->GetScriptResourceName(): string(7) "test.js" -V8\Message->GetStackTrace(): NULL -V8\Message->GetLineNumber(): int(11) -V8\Message->GetStartPosition(): int(231) -V8\Message->GetEndPosition(): int(232) -V8\Message->GetStartColumn(): int(8) -V8\Message->GetEndColumn(): int(9) -V8\Message->IsSharedCrossOrigin(): bool(false) -V8\Message->IsOpaque(): bool(false) - -Message created from created value: ------------------------------------ -V8\Message->Get(): string(13) "Uncaught test" -V8\Message->GetSourceLine(): string(24) " test(exception);" -V8\Message->GetScriptOrigin(): - object(V8\ScriptOrigin)#35 (6) { - ["resource_name":"V8\ScriptOrigin":private]=> - string(7) "test.js" - ["resource_line_offset":"V8\ScriptOrigin":private]=> - int(0) - ["resource_column_offset":"V8\ScriptOrigin":private]=> - int(0) - ["options":"V8\ScriptOrigin":private]=> - object(V8\ScriptOriginOptions)#34 (4) { - ["is_shared_cross_origin":"V8\ScriptOriginOptions":private]=> - bool(false) - ["is_opaque":"V8\ScriptOriginOptions":private]=> - bool(false) - ["is_wasm":"V8\ScriptOriginOptions":private]=> - bool(false) - ["is_module":"V8\ScriptOriginOptions":private]=> - bool(false) - } - ["script_id":"V8\ScriptOrigin":private]=> - int(%d) - ["source_map_url":"V8\ScriptOrigin":private]=> - string(0) "" - } -V8\Message->GetScriptResourceName(): string(7) "test.js" -V8\Message->GetStackTrace(): NULL -V8\Message->GetLineNumber(): int(11) -V8\Message->GetStartPosition(): int(231) -V8\Message->GetEndPosition(): int(232) -V8\Message->GetStartColumn(): int(8) -V8\Message->GetEndColumn(): int(9) -V8\Message->IsSharedCrossOrigin(): bool(false) -V8\Message->IsOpaque(): bool(false) - - -Checks on V8\ObjectValue: -------------------------- -V8\ObjectValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\ObjectValue->IsCallable(): bool(false) -V8\ObjectValue->IsConstructor(): bool(false) -V8\ObjectValue(V8\Value)->IsUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsNull(): bool(false) -V8\ObjectValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsTrue(): bool(false) -V8\ObjectValue(V8\Value)->IsFalse(): bool(false) -V8\ObjectValue(V8\Value)->IsName(): bool(false) -V8\ObjectValue(V8\Value)->IsString(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbol(): bool(false) -V8\ObjectValue(V8\Value)->IsFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsArray(): bool(false) -V8\ObjectValue(V8\Value)->IsObject(): bool(true) -V8\ObjectValue(V8\Value)->IsBoolean(): bool(false) -V8\ObjectValue(V8\Value)->IsNumber(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32(): bool(false) -V8\ObjectValue(V8\Value)->IsDate(): bool(false) -V8\ObjectValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\ObjectValue(V8\Value)->IsBooleanObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNumberObject(): bool(false) -V8\ObjectValue(V8\Value)->IsStringObject(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbolObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNativeError(): bool(false) -V8\ObjectValue(V8\Value)->IsRegExp(): bool(false) -V8\ObjectValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\ObjectValue(V8\Value)->IsPromise(): bool(false) -V8\ObjectValue(V8\Value)->IsMap(): bool(false) -V8\ObjectValue(V8\Value)->IsSet(): bool(false) -V8\ObjectValue(V8\Value)->IsMapIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsSetIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakMap(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakSet(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\ObjectValue(V8\Value)->IsTypedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsInt8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat64Array(): bool(false) -V8\ObjectValue(V8\Value)->IsDataView(): bool(false) -V8\ObjectValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsProxy(): bool(false) - - -EOF diff --git a/tests/V8Exception_Error.phpt b/tests/V8Exception_Error.phpt deleted file mode 100644 index b3dfabc..0000000 --- a/tests/V8Exception_Error.phpt +++ /dev/null @@ -1,155 +0,0 @@ ---TEST-- -V8\Exception::Error() ---SKIPIF-- - ---FILE-- -assert('Can create error when out of context', $error instanceof \V8\Value); -} catch (\Exception $e) { - $helper->exception_export($e); -} - -$helper->line(); - -$func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) { - $value = count($info->Arguments()) ? $info->Arguments()[0] : new \V8\StringValue($info->GetIsolate(), "exception"); - - $info->GetIsolate()->ThrowException($info->GetContext(), V8\Exception::Error($info->GetContext(), $value)); -}); - -$func_test_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper, $v8_helper) { - - $message = new \V8\StringValue($info->GetIsolate(), "test"); - $value1 = V8\Exception::Error($info->GetContext(), $message); - $value2 = V8\Exception::Error($info->GetContext(), $message); - - $context = $info->GetContext(); - - $v8_helper->CHECK_NE($value1, $value2); - $v8_helper->CHECK(!$value1->Equals($context, $value2), '!$value1->Equals($context, $value2)'); - $v8_helper->CHECK(!$value2->Equals($context, $value1), '!$value2->Equals($context, $value1)'); - - $v8_helper->CHECK(!$value1->StrictEquals($value2), '!$value1->StrictEquals($value2)'); - $v8_helper->CHECK(!$value2->StrictEquals($value1), '!$value2->StrictEquals($value1)'); - - $v8_helper->CHECK(!$value1->SameValue($value2), '!$value1->SameValue($value2)'); - $v8_helper->CHECK(!$value2->SameValue($value1), '!$value2->SameValue($value1)'); - - $helper->line(); -}); - -$global_tpl = new \V8\ObjectTemplate($isolate); -$global_tpl->Set(new \V8\StringValue($isolate, 'e'), $func_tpl); - -$global_tpl->Set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); - -$context = new \V8\Context($isolate, $global_tpl); -$v8_helper->injectConsoleLog($context); - -$v8_helper->CompileTryRun($context, 'test()'); -$v8_helper->CompileTryRun($context, 'e()'); -$v8_helper->CompileTryRun($context, 'e("test")'); - -$source = ' - var ex; - - try { - e("foo"); - } catch (exception) { - console.log("exception: ", "\'", exception, "\'"); - console.log("exception.stack: ", exception.stack); - ex = exception; - } - - ex -'; - -$helper->line(); - -$res = $v8_helper->CompileRun($context, $source); -$helper->line(); - -$v8_helper->run_checks($res); -?> ---EXPECT-- -Can create error when out of context: ok - -CHECK_NE: OK -CHECK !$value1->Equals($context, $value2): OK -CHECK !$value2->Equals($context, $value1): OK -CHECK !$value1->StrictEquals($value2): OK -CHECK !$value2->StrictEquals($value1): OK -CHECK !$value1->SameValue($value2): OK -CHECK !$value2->SameValue($value1): OK - -e(): V8\Exceptions\TryCatchException: Error: exception -e("test"): V8\Exceptions\TryCatchException: Error: test - -exception: 'Error: foo' -exception.stack: Error: foo - at test.js:5:9 - -Checks on V8\ObjectValue: -------------------------- -V8\ObjectValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\ObjectValue->IsCallable(): bool(false) -V8\ObjectValue->IsConstructor(): bool(false) -V8\ObjectValue(V8\Value)->IsUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsNull(): bool(false) -V8\ObjectValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsTrue(): bool(false) -V8\ObjectValue(V8\Value)->IsFalse(): bool(false) -V8\ObjectValue(V8\Value)->IsName(): bool(false) -V8\ObjectValue(V8\Value)->IsString(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbol(): bool(false) -V8\ObjectValue(V8\Value)->IsFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsArray(): bool(false) -V8\ObjectValue(V8\Value)->IsObject(): bool(true) -V8\ObjectValue(V8\Value)->IsBoolean(): bool(false) -V8\ObjectValue(V8\Value)->IsNumber(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32(): bool(false) -V8\ObjectValue(V8\Value)->IsDate(): bool(false) -V8\ObjectValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\ObjectValue(V8\Value)->IsBooleanObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNumberObject(): bool(false) -V8\ObjectValue(V8\Value)->IsStringObject(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbolObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNativeError(): bool(true) -V8\ObjectValue(V8\Value)->IsRegExp(): bool(false) -V8\ObjectValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\ObjectValue(V8\Value)->IsPromise(): bool(false) -V8\ObjectValue(V8\Value)->IsMap(): bool(false) -V8\ObjectValue(V8\Value)->IsSet(): bool(false) -V8\ObjectValue(V8\Value)->IsMapIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsSetIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakMap(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakSet(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\ObjectValue(V8\Value)->IsTypedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsInt8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat64Array(): bool(false) -V8\ObjectValue(V8\Value)->IsDataView(): bool(false) -V8\ObjectValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsProxy(): bool(false) diff --git a/tests/V8Exception_RangeError.phpt b/tests/V8Exception_RangeError.phpt deleted file mode 100644 index 3af2a51..0000000 --- a/tests/V8Exception_RangeError.phpt +++ /dev/null @@ -1,155 +0,0 @@ ---TEST-- -V8\Exception::RangeError() ---SKIPIF-- - ---FILE-- -assert('Can create error when out of context', $error instanceof \V8\Value); -} catch (\Exception $e) { - $helper->exception_export($e); -} - -$helper->line(); - -$func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) { - $value = count($info->Arguments()) ? $info->Arguments()[0] : new \V8\StringValue($info->GetIsolate(), "exception"); - - $info->GetIsolate()->ThrowException($info->GetContext(), V8\Exception::RangeError($info->GetContext(), $value)); -}); - -$func_test_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper, $v8_helper) { - - $message = new \V8\StringValue($info->GetIsolate(), "test"); - $value1 = V8\Exception::RangeError($info->GetContext(), $message); - $value2 = V8\Exception::RangeError($info->GetContext(), $message); - - $context = $info->GetContext(); - - $v8_helper->CHECK_NE($value1, $value2); - $v8_helper->CHECK(!$value1->Equals($context, $value2), '!$value1->Equals($context, $value2)'); - $v8_helper->CHECK(!$value2->Equals($context, $value1), '!$value2->Equals($context, $value1)'); - - $v8_helper->CHECK(!$value1->StrictEquals($value2), '!$value1->StrictEquals($value2)'); - $v8_helper->CHECK(!$value2->StrictEquals($value1), '!$value2->StrictEquals($value1)'); - - $v8_helper->CHECK(!$value1->SameValue($value2), '!$value1->SameValue($value2)'); - $v8_helper->CHECK(!$value2->SameValue($value1), '!$value2->SameValue($value1)'); - - $helper->line(); -}); - -$global_tpl = new \V8\ObjectTemplate($isolate); -$global_tpl->Set(new \V8\StringValue($isolate, 'e'), $func_tpl); -$global_tpl->Set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); - -$context = new \V8\Context($isolate, $global_tpl); -$v8_helper->injectConsoleLog($context); - -$v8_helper->CompileTryRun($context, 'test()'); -$v8_helper->CompileTryRun($context, 'e()'); -$v8_helper->CompileTryRun($context, 'e("test")'); - -$source = ' - var ex; - - try { - e("foo"); - } catch (exception) { - console.log("exception: ", "\'", exception, "\'"); - console.log("exception.stack: ", exception.stack); - ex = exception; - } - - ex -'; - -$helper->line(); - -$res = $v8_helper->CompileRun($context, $source); -$helper->line(); - -$v8_helper->run_checks($res); -?> ---EXPECT-- -Can create error when out of context: ok - -CHECK_NE: OK -CHECK !$value1->Equals($context, $value2): OK -CHECK !$value2->Equals($context, $value1): OK -CHECK !$value1->StrictEquals($value2): OK -CHECK !$value2->StrictEquals($value1): OK -CHECK !$value1->SameValue($value2): OK -CHECK !$value2->SameValue($value1): OK - -e(): V8\Exceptions\TryCatchException: RangeError: exception -e("test"): V8\Exceptions\TryCatchException: RangeError: test - -exception: 'RangeError: foo' -exception.stack: RangeError: foo - at test.js:5:9 - -Checks on V8\ObjectValue: -------------------------- -V8\ObjectValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\ObjectValue->IsCallable(): bool(false) -V8\ObjectValue->IsConstructor(): bool(false) -V8\ObjectValue(V8\Value)->IsUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsNull(): bool(false) -V8\ObjectValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsTrue(): bool(false) -V8\ObjectValue(V8\Value)->IsFalse(): bool(false) -V8\ObjectValue(V8\Value)->IsName(): bool(false) -V8\ObjectValue(V8\Value)->IsString(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbol(): bool(false) -V8\ObjectValue(V8\Value)->IsFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsArray(): bool(false) -V8\ObjectValue(V8\Value)->IsObject(): bool(true) -V8\ObjectValue(V8\Value)->IsBoolean(): bool(false) -V8\ObjectValue(V8\Value)->IsNumber(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32(): bool(false) -V8\ObjectValue(V8\Value)->IsDate(): bool(false) -V8\ObjectValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\ObjectValue(V8\Value)->IsBooleanObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNumberObject(): bool(false) -V8\ObjectValue(V8\Value)->IsStringObject(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbolObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNativeError(): bool(true) -V8\ObjectValue(V8\Value)->IsRegExp(): bool(false) -V8\ObjectValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\ObjectValue(V8\Value)->IsPromise(): bool(false) -V8\ObjectValue(V8\Value)->IsMap(): bool(false) -V8\ObjectValue(V8\Value)->IsSet(): bool(false) -V8\ObjectValue(V8\Value)->IsMapIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsSetIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakMap(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakSet(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\ObjectValue(V8\Value)->IsTypedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsInt8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat64Array(): bool(false) -V8\ObjectValue(V8\Value)->IsDataView(): bool(false) -V8\ObjectValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsProxy(): bool(false) diff --git a/tests/V8Exception_ReferenceError.phpt b/tests/V8Exception_ReferenceError.phpt deleted file mode 100644 index 9c7c318..0000000 --- a/tests/V8Exception_ReferenceError.phpt +++ /dev/null @@ -1,155 +0,0 @@ ---TEST-- -V8\Exception::ReferenceError() ---SKIPIF-- - ---FILE-- -assert('Can create error when out of context', $error instanceof \V8\Value); -} catch (\Exception $e) { - $helper->exception_export($e); -} - -$helper->line(); - -$func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) { - $value = count($info->Arguments()) ? $info->Arguments()[0] : new \V8\StringValue($info->GetIsolate(), "exception"); - - $info->GetIsolate()->ThrowException($info->GetContext(), V8\Exception::ReferenceError($info->GetContext(), $value)); -}); - -$func_test_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper, $v8_helper) { - - $message = new \V8\StringValue($info->GetIsolate(), "test"); - $value1 = V8\Exception::ReferenceError($info->GetContext(), $message); - $value2 = V8\Exception::ReferenceError($info->GetContext(), $message); - - $context = $info->GetContext(); - - $v8_helper->CHECK_NE($value1, $value2); - $v8_helper->CHECK(!$value1->Equals($context, $value2), '!$value1->Equals($context, $value2)'); - $v8_helper->CHECK(!$value2->Equals($context, $value1), '!$value2->Equals($context, $value1)'); - - $v8_helper->CHECK(!$value1->StrictEquals($value2), '!$value1->StrictEquals($value2)'); - $v8_helper->CHECK(!$value2->StrictEquals($value1), '!$value2->StrictEquals($value1)'); - - $v8_helper->CHECK(!$value1->SameValue($value2), '!$value1->SameValue($value2)'); - $v8_helper->CHECK(!$value2->SameValue($value1), '!$value2->SameValue($value1)'); - - $helper->line(); -}); - -$global_tpl = new \V8\ObjectTemplate($isolate); -$global_tpl->Set(new \V8\StringValue($isolate, 'e'), $func_tpl); -$global_tpl->Set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); - -$context = new \V8\Context($isolate, $global_tpl); -$v8_helper->injectConsoleLog($context); - -$v8_helper->CompileTryRun($context, 'test()'); -$v8_helper->CompileTryRun($context, 'e()'); -$v8_helper->CompileTryRun($context, 'e("test")'); - -$source = ' - var ex; - - try { - e("foo"); - } catch (exception) { - console.log("exception: ", "\'", exception, "\'"); - console.log("exception.stack: ", exception.stack); - ex = exception; - } - - ex -'; - -$helper->line(); - -$res = $v8_helper->CompileRun($context, $source); -$helper->line(); - -$v8_helper->run_checks($res); -?> ---EXPECT-- -Can create error when out of context: ok - -CHECK_NE: OK -CHECK !$value1->Equals($context, $value2): OK -CHECK !$value2->Equals($context, $value1): OK -CHECK !$value1->StrictEquals($value2): OK -CHECK !$value2->StrictEquals($value1): OK -CHECK !$value1->SameValue($value2): OK -CHECK !$value2->SameValue($value1): OK - -e(): V8\Exceptions\TryCatchException: ReferenceError: exception -e("test"): V8\Exceptions\TryCatchException: ReferenceError: test - -exception: 'ReferenceError: foo' -exception.stack: ReferenceError: foo - at test.js:5:9 - -Checks on V8\ObjectValue: -------------------------- -V8\ObjectValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\ObjectValue->IsCallable(): bool(false) -V8\ObjectValue->IsConstructor(): bool(false) -V8\ObjectValue(V8\Value)->IsUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsNull(): bool(false) -V8\ObjectValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsTrue(): bool(false) -V8\ObjectValue(V8\Value)->IsFalse(): bool(false) -V8\ObjectValue(V8\Value)->IsName(): bool(false) -V8\ObjectValue(V8\Value)->IsString(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbol(): bool(false) -V8\ObjectValue(V8\Value)->IsFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsArray(): bool(false) -V8\ObjectValue(V8\Value)->IsObject(): bool(true) -V8\ObjectValue(V8\Value)->IsBoolean(): bool(false) -V8\ObjectValue(V8\Value)->IsNumber(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32(): bool(false) -V8\ObjectValue(V8\Value)->IsDate(): bool(false) -V8\ObjectValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\ObjectValue(V8\Value)->IsBooleanObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNumberObject(): bool(false) -V8\ObjectValue(V8\Value)->IsStringObject(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbolObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNativeError(): bool(true) -V8\ObjectValue(V8\Value)->IsRegExp(): bool(false) -V8\ObjectValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\ObjectValue(V8\Value)->IsPromise(): bool(false) -V8\ObjectValue(V8\Value)->IsMap(): bool(false) -V8\ObjectValue(V8\Value)->IsSet(): bool(false) -V8\ObjectValue(V8\Value)->IsMapIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsSetIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakMap(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakSet(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\ObjectValue(V8\Value)->IsTypedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsInt8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat64Array(): bool(false) -V8\ObjectValue(V8\Value)->IsDataView(): bool(false) -V8\ObjectValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsProxy(): bool(false) diff --git a/tests/V8Exception_SyntaxError.phpt b/tests/V8Exception_SyntaxError.phpt deleted file mode 100644 index d4a4a4e..0000000 --- a/tests/V8Exception_SyntaxError.phpt +++ /dev/null @@ -1,155 +0,0 @@ ---TEST-- -V8\Exception::SyntaxError() ---SKIPIF-- - ---FILE-- -assert('Can create error when out of context', $error instanceof \V8\Value); -} catch (\Exception $e) { - $helper->exception_export($e); -} - -$helper->line(); - -$func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) { - $value = count($info->Arguments()) ? $info->Arguments()[0] : new \V8\StringValue($info->GetIsolate(), "exception"); - - $info->GetIsolate()->ThrowException($info->GetContext(), V8\Exception::SyntaxError($info->GetContext(), $value)); -}); - -$func_test_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper, $v8_helper) { - - $message = new \V8\StringValue($info->GetIsolate(), "test"); - $value1 = V8\Exception::SyntaxError($info->GetContext(), $message); - $value2 = V8\Exception::SyntaxError($info->GetContext(), $message); - - $context = $info->GetContext(); - - $v8_helper->CHECK_NE($value1, $value2); - $v8_helper->CHECK(!$value1->Equals($context, $value2), '!$value1->Equals($context, $value2)'); - $v8_helper->CHECK(!$value2->Equals($context, $value1), '!$value2->Equals($context, $value1)'); - - $v8_helper->CHECK(!$value1->StrictEquals($value2), '!$value1->StrictEquals($value2)'); - $v8_helper->CHECK(!$value2->StrictEquals($value1), '!$value2->StrictEquals($value1)'); - - $v8_helper->CHECK(!$value1->SameValue($value2), '!$value1->SameValue($value2)'); - $v8_helper->CHECK(!$value2->SameValue($value1), '!$value2->SameValue($value1)'); - - $helper->line(); -}); - -$global_tpl = new \V8\ObjectTemplate($isolate); -$global_tpl->Set(new \V8\StringValue($isolate, 'e'), $func_tpl); -$global_tpl->Set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); - -$context = new \V8\Context($isolate, $global_tpl); -$v8_helper->injectConsoleLog($context); - -$v8_helper->CompileTryRun($context, 'test()'); -$v8_helper->CompileTryRun($context, 'e()'); -$v8_helper->CompileTryRun($context, 'e("test")'); - -$source = ' - var ex; - - try { - e("foo"); - } catch (exception) { - console.log("exception: ", "\'", exception, "\'"); - console.log("exception.stack: ", exception.stack); - ex = exception; - } - - ex -'; - -$helper->line(); - -$res = $v8_helper->CompileRun($context, $source); -$helper->line(); - -$v8_helper->run_checks($res); -?> ---EXPECT-- -Can create error when out of context: ok - -CHECK_NE: OK -CHECK !$value1->Equals($context, $value2): OK -CHECK !$value2->Equals($context, $value1): OK -CHECK !$value1->StrictEquals($value2): OK -CHECK !$value2->StrictEquals($value1): OK -CHECK !$value1->SameValue($value2): OK -CHECK !$value2->SameValue($value1): OK - -e(): V8\Exceptions\TryCatchException: SyntaxError: exception -e("test"): V8\Exceptions\TryCatchException: SyntaxError: test - -exception: 'SyntaxError: foo' -exception.stack: SyntaxError: foo - at test.js:5:9 - -Checks on V8\ObjectValue: -------------------------- -V8\ObjectValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\ObjectValue->IsCallable(): bool(false) -V8\ObjectValue->IsConstructor(): bool(false) -V8\ObjectValue(V8\Value)->IsUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsNull(): bool(false) -V8\ObjectValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsTrue(): bool(false) -V8\ObjectValue(V8\Value)->IsFalse(): bool(false) -V8\ObjectValue(V8\Value)->IsName(): bool(false) -V8\ObjectValue(V8\Value)->IsString(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbol(): bool(false) -V8\ObjectValue(V8\Value)->IsFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsArray(): bool(false) -V8\ObjectValue(V8\Value)->IsObject(): bool(true) -V8\ObjectValue(V8\Value)->IsBoolean(): bool(false) -V8\ObjectValue(V8\Value)->IsNumber(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32(): bool(false) -V8\ObjectValue(V8\Value)->IsDate(): bool(false) -V8\ObjectValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\ObjectValue(V8\Value)->IsBooleanObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNumberObject(): bool(false) -V8\ObjectValue(V8\Value)->IsStringObject(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbolObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNativeError(): bool(true) -V8\ObjectValue(V8\Value)->IsRegExp(): bool(false) -V8\ObjectValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\ObjectValue(V8\Value)->IsPromise(): bool(false) -V8\ObjectValue(V8\Value)->IsMap(): bool(false) -V8\ObjectValue(V8\Value)->IsSet(): bool(false) -V8\ObjectValue(V8\Value)->IsMapIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsSetIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakMap(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakSet(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\ObjectValue(V8\Value)->IsTypedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsInt8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat64Array(): bool(false) -V8\ObjectValue(V8\Value)->IsDataView(): bool(false) -V8\ObjectValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsProxy(): bool(false) diff --git a/tests/V8Exception_TypeError.phpt b/tests/V8Exception_TypeError.phpt deleted file mode 100644 index c110ab2..0000000 --- a/tests/V8Exception_TypeError.phpt +++ /dev/null @@ -1,155 +0,0 @@ ---TEST-- -V8\Exception::TypeError() ---SKIPIF-- - ---FILE-- -assert('Can create error when out of context', $error instanceof \V8\Value); -} catch (\Exception $e) { - $helper->exception_export($e); -} - -$helper->line(); - -$func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) { - $value = count($info->Arguments()) ? $info->Arguments()[0] : new \V8\StringValue($info->GetIsolate(), "exception"); - - $info->GetIsolate()->ThrowException($info->GetContext(), V8\Exception::TypeError($info->GetContext(), $value)); -}); - -$func_test_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper, $v8_helper) { - - $message = new \V8\StringValue($info->GetIsolate(), "test"); - $value1 = V8\Exception::TypeError($info->GetContext(), $message); - $value2 = V8\Exception::TypeError($info->GetContext(), $message); - - $context = $info->GetContext(); - - $v8_helper->CHECK_NE($value1, $value2); - $v8_helper->CHECK(!$value1->Equals($context, $value2), '!$value1->Equals($context, $value2)'); - $v8_helper->CHECK(!$value2->Equals($context, $value1), '!$value2->Equals($context, $value1)'); - - $v8_helper->CHECK(!$value1->StrictEquals($value2), '!$value1->StrictEquals($value2)'); - $v8_helper->CHECK(!$value2->StrictEquals($value1), '!$value2->StrictEquals($value1)'); - - $v8_helper->CHECK(!$value1->SameValue($value2), '!$value1->SameValue($value2)'); - $v8_helper->CHECK(!$value2->SameValue($value1), '!$value2->SameValue($value1)'); - - $helper->line(); -}); - -$global_tpl = new \V8\ObjectTemplate($isolate); -$global_tpl->Set(new \V8\StringValue($isolate, 'e'), $func_tpl); -$global_tpl->Set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); - -$context = new \V8\Context($isolate, $global_tpl); -$v8_helper->injectConsoleLog($context); - -$v8_helper->CompileTryRun($context, 'test()'); -$v8_helper->CompileTryRun($context, 'e()'); -$v8_helper->CompileTryRun($context, 'e("test")'); - -$source = ' - var ex; - - try { - e("foo"); - } catch (exception) { - console.log("exception: ", "\'", exception, "\'"); - console.log("exception.stack: ", exception.stack); - ex = exception; - } - - ex -'; - -$helper->line(); - -$res = $v8_helper->CompileRun($context, $source); -$helper->line(); - -$v8_helper->run_checks($res); -?> ---EXPECT-- -Can create error when out of context: ok - -CHECK_NE: OK -CHECK !$value1->Equals($context, $value2): OK -CHECK !$value2->Equals($context, $value1): OK -CHECK !$value1->StrictEquals($value2): OK -CHECK !$value2->StrictEquals($value1): OK -CHECK !$value1->SameValue($value2): OK -CHECK !$value2->SameValue($value1): OK - -e(): V8\Exceptions\TryCatchException: TypeError: exception -e("test"): V8\Exceptions\TryCatchException: TypeError: test - -exception: 'TypeError: foo' -exception.stack: TypeError: foo - at test.js:5:9 - -Checks on V8\ObjectValue: -------------------------- -V8\ObjectValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\ObjectValue->IsCallable(): bool(false) -V8\ObjectValue->IsConstructor(): bool(false) -V8\ObjectValue(V8\Value)->IsUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsNull(): bool(false) -V8\ObjectValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsTrue(): bool(false) -V8\ObjectValue(V8\Value)->IsFalse(): bool(false) -V8\ObjectValue(V8\Value)->IsName(): bool(false) -V8\ObjectValue(V8\Value)->IsString(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbol(): bool(false) -V8\ObjectValue(V8\Value)->IsFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsArray(): bool(false) -V8\ObjectValue(V8\Value)->IsObject(): bool(true) -V8\ObjectValue(V8\Value)->IsBoolean(): bool(false) -V8\ObjectValue(V8\Value)->IsNumber(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32(): bool(false) -V8\ObjectValue(V8\Value)->IsDate(): bool(false) -V8\ObjectValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\ObjectValue(V8\Value)->IsBooleanObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNumberObject(): bool(false) -V8\ObjectValue(V8\Value)->IsStringObject(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbolObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNativeError(): bool(true) -V8\ObjectValue(V8\Value)->IsRegExp(): bool(false) -V8\ObjectValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\ObjectValue(V8\Value)->IsPromise(): bool(false) -V8\ObjectValue(V8\Value)->IsMap(): bool(false) -V8\ObjectValue(V8\Value)->IsSet(): bool(false) -V8\ObjectValue(V8\Value)->IsMapIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsSetIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakMap(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakSet(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\ObjectValue(V8\Value)->IsTypedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsInt8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat64Array(): bool(false) -V8\ObjectValue(V8\Value)->IsDataView(): bool(false) -V8\ObjectValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsProxy(): bool(false) diff --git a/tests/V8Exception_createMessage.phpt b/tests/V8Exception_createMessage.phpt new file mode 100644 index 0000000..2aee6e9 --- /dev/null +++ b/tests/V8Exception_createMessage.phpt @@ -0,0 +1,219 @@ +--TEST-- +V8\Exception::createMessage() +--SKIPIF-- + +--FILE-- +assert('Can create message when out of context', $message instanceof \V8\Message); +} catch (\Exception $e) { + $helper->exception_export($e); +} + +$helper->line(); + + +$func_test_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper, $v8_helper) { + + $helper->assert('Exception passed', count($info->arguments()) == 1); + $helper->line(); + + $exception = $info->arguments()[0]; + + $message = V8\Exception::createMessage($info->getContext(), $exception); + $helper->header('Message created from thrown value'); + $helper->dump_object_methods($message); + $helper->line(); + + $exception = new \V8\StringValue($info->getIsolate(), 'test'); + $message = V8\Exception::createMessage($info->getContext(), $exception); + $helper->header('Message created from created value'); + $helper->dump_object_methods($message); + $helper->line(); +}); + +$global_tpl = new \V8\ObjectTemplate($isolate); +$global_tpl->set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); + +$context = new \V8\Context($isolate, $global_tpl); +$v8_helper->injectConsoleLog($context); + + +$source = ' + var ex; + + try { + throw {test: "error"}; + } catch (exception) { + console.log("exception: ", "\'", exception, "\'"); + console.log("exception.stack: ", exception.stack); + console.log(""); + + test(exception); + + ex = exception; + } + + ex +'; + +$res = $v8_helper->CompileRun($context, $source); +$helper->line(); + +$v8_helper->run_checks($res); + +// EXPECTF: ---/\["script_id":"V8\\ScriptOrigin":private\]=>\n int\(\d+\)/ +// EXPECTF: +++["script_id":"V8\ScriptOrigin":private]=>\n int(%d) +?> +EOF +--EXPECTF-- +Can create message when out of context: ok + +exception: '[object Object]' +exception.stack: + +Exception passed: ok + +Message created from thrown value: +---------------------------------- +V8\Message->get(): string(18) "Uncaught #" +V8\Message->getSourceLine(): string(24) " test(exception);" +V8\Message->getScriptOrigin(): + object(V8\ScriptOrigin)#15 (6) { + ["resource_name":"V8\ScriptOrigin":private]=> + string(7) "test.js" + ["resource_line_offset":"V8\ScriptOrigin":private]=> + int(0) + ["resource_column_offset":"V8\ScriptOrigin":private]=> + int(0) + ["options":"V8\ScriptOrigin":private]=> + object(V8\ScriptOriginOptions)#13 (4) { + ["is_shared_cross_origin":"V8\ScriptOriginOptions":private]=> + bool(false) + ["is_opaque":"V8\ScriptOriginOptions":private]=> + bool(false) + ["is_wasm":"V8\ScriptOriginOptions":private]=> + bool(false) + ["is_module":"V8\ScriptOriginOptions":private]=> + bool(false) + } + ["script_id":"V8\ScriptOrigin":private]=> + int(%d) + ["source_map_url":"V8\ScriptOrigin":private]=> + string(0) "" + } +V8\Message->getScriptResourceName(): string(7) "test.js" +V8\Message->getStackTrace(): NULL +V8\Message->getLineNumber(): int(11) +V8\Message->getStartPosition(): int(231) +V8\Message->getEndPosition(): int(232) +V8\Message->getStartColumn(): int(8) +V8\Message->getEndColumn(): int(9) +V8\Message->isSharedCrossOrigin(): bool(false) +V8\Message->isOpaque(): bool(false) + +Message created from created value: +----------------------------------- +V8\Message->get(): string(13) "Uncaught test" +V8\Message->getSourceLine(): string(24) " test(exception);" +V8\Message->getScriptOrigin(): + object(V8\ScriptOrigin)#35 (6) { + ["resource_name":"V8\ScriptOrigin":private]=> + string(7) "test.js" + ["resource_line_offset":"V8\ScriptOrigin":private]=> + int(0) + ["resource_column_offset":"V8\ScriptOrigin":private]=> + int(0) + ["options":"V8\ScriptOrigin":private]=> + object(V8\ScriptOriginOptions)#34 (4) { + ["is_shared_cross_origin":"V8\ScriptOriginOptions":private]=> + bool(false) + ["is_opaque":"V8\ScriptOriginOptions":private]=> + bool(false) + ["is_wasm":"V8\ScriptOriginOptions":private]=> + bool(false) + ["is_module":"V8\ScriptOriginOptions":private]=> + bool(false) + } + ["script_id":"V8\ScriptOrigin":private]=> + int(%d) + ["source_map_url":"V8\ScriptOrigin":private]=> + string(0) "" + } +V8\Message->getScriptResourceName(): string(7) "test.js" +V8\Message->getStackTrace(): NULL +V8\Message->getLineNumber(): int(11) +V8\Message->getStartPosition(): int(231) +V8\Message->getEndPosition(): int(232) +V8\Message->getStartColumn(): int(8) +V8\Message->getEndColumn(): int(9) +V8\Message->isSharedCrossOrigin(): bool(false) +V8\Message->isOpaque(): bool(false) + + +Checks on V8\ObjectValue: +------------------------- +V8\ObjectValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\ObjectValue->isCallable(): bool(false) +V8\ObjectValue->isConstructor(): bool(false) +V8\ObjectValue(V8\Value)->isUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isNull(): bool(false) +V8\ObjectValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isTrue(): bool(false) +V8\ObjectValue(V8\Value)->isFalse(): bool(false) +V8\ObjectValue(V8\Value)->isName(): bool(false) +V8\ObjectValue(V8\Value)->isString(): bool(false) +V8\ObjectValue(V8\Value)->isSymbol(): bool(false) +V8\ObjectValue(V8\Value)->isFunction(): bool(false) +V8\ObjectValue(V8\Value)->isArray(): bool(false) +V8\ObjectValue(V8\Value)->isObject(): bool(true) +V8\ObjectValue(V8\Value)->isBoolean(): bool(false) +V8\ObjectValue(V8\Value)->isNumber(): bool(false) +V8\ObjectValue(V8\Value)->isInt32(): bool(false) +V8\ObjectValue(V8\Value)->isUint32(): bool(false) +V8\ObjectValue(V8\Value)->isDate(): bool(false) +V8\ObjectValue(V8\Value)->isArgumentsObject(): bool(false) +V8\ObjectValue(V8\Value)->isBooleanObject(): bool(false) +V8\ObjectValue(V8\Value)->isNumberObject(): bool(false) +V8\ObjectValue(V8\Value)->isStringObject(): bool(false) +V8\ObjectValue(V8\Value)->isSymbolObject(): bool(false) +V8\ObjectValue(V8\Value)->isNativeError(): bool(false) +V8\ObjectValue(V8\Value)->isRegExp(): bool(false) +V8\ObjectValue(V8\Value)->isAsyncFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorObject(): bool(false) +V8\ObjectValue(V8\Value)->isPromise(): bool(false) +V8\ObjectValue(V8\Value)->isMap(): bool(false) +V8\ObjectValue(V8\Value)->isSet(): bool(false) +V8\ObjectValue(V8\Value)->isMapIterator(): bool(false) +V8\ObjectValue(V8\Value)->isSetIterator(): bool(false) +V8\ObjectValue(V8\Value)->isWeakMap(): bool(false) +V8\ObjectValue(V8\Value)->isWeakSet(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBufferView(): bool(false) +V8\ObjectValue(V8\Value)->isTypedArray(): bool(false) +V8\ObjectValue(V8\Value)->isUint8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\ObjectValue(V8\Value)->isInt8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint16Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt16Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint32Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat64Array(): bool(false) +V8\ObjectValue(V8\Value)->isDataView(): bool(false) +V8\ObjectValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isProxy(): bool(false) + + +EOF diff --git a/tests/V8Exception_error.phpt b/tests/V8Exception_error.phpt new file mode 100644 index 0000000..c979538 --- /dev/null +++ b/tests/V8Exception_error.phpt @@ -0,0 +1,155 @@ +--TEST-- +V8\Exception::error() +--SKIPIF-- + +--FILE-- +assert('Can create error when out of context', $error instanceof \V8\Value); +} catch (\Exception $e) { + $helper->exception_export($e); +} + +$helper->line(); + +$func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) { + $value = count($info->arguments()) ? $info->arguments()[0] : new \V8\StringValue($info->getIsolate(), "exception"); + + $info->getIsolate()->throwException($info->getContext(), V8\Exception::error($info->getContext(), $value)); +}); + +$func_test_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper, $v8_helper) { + + $message = new \V8\StringValue($info->getIsolate(), "test"); + $value1 = V8\Exception::error($info->getContext(), $message); + $value2 = V8\Exception::error($info->getContext(), $message); + + $context = $info->getContext(); + + $v8_helper->CHECK_NE($value1, $value2); + $v8_helper->CHECK(!$value1->equals($context, $value2), '!$value1->equals($context, $value2)'); + $v8_helper->CHECK(!$value2->equals($context, $value1), '!$value2->equals($context, $value1)'); + + $v8_helper->CHECK(!$value1->strictEquals($value2), '!$value1->strictEquals($value2)'); + $v8_helper->CHECK(!$value2->strictEquals($value1), '!$value2->strictEquals($value1)'); + + $v8_helper->CHECK(!$value1->sameValue($value2), '!$value1->sameValue($value2)'); + $v8_helper->CHECK(!$value2->sameValue($value1), '!$value2->sameValue($value1)'); + + $helper->line(); +}); + +$global_tpl = new \V8\ObjectTemplate($isolate); +$global_tpl->set(new \V8\StringValue($isolate, 'e'), $func_tpl); + +$global_tpl->set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); + +$context = new \V8\Context($isolate, $global_tpl); +$v8_helper->injectConsoleLog($context); + +$v8_helper->CompileTryRun($context, 'test()'); +$v8_helper->CompileTryRun($context, 'e()'); +$v8_helper->CompileTryRun($context, 'e("test")'); + +$source = ' + var ex; + + try { + e("foo"); + } catch (exception) { + console.log("exception: ", "\'", exception, "\'"); + console.log("exception.stack: ", exception.stack); + ex = exception; + } + + ex +'; + +$helper->line(); + +$res = $v8_helper->CompileRun($context, $source); +$helper->line(); + +$v8_helper->run_checks($res); +?> +--EXPECT-- +Can create error when out of context: ok + +CHECK_NE: OK +CHECK !$value1->equals($context, $value2): OK +CHECK !$value2->equals($context, $value1): OK +CHECK !$value1->strictEquals($value2): OK +CHECK !$value2->strictEquals($value1): OK +CHECK !$value1->sameValue($value2): OK +CHECK !$value2->sameValue($value1): OK + +e(): V8\Exceptions\TryCatchException: Error: exception +e("test"): V8\Exceptions\TryCatchException: Error: test + +exception: 'Error: foo' +exception.stack: Error: foo + at test.js:5:9 + +Checks on V8\ObjectValue: +------------------------- +V8\ObjectValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\ObjectValue->isCallable(): bool(false) +V8\ObjectValue->isConstructor(): bool(false) +V8\ObjectValue(V8\Value)->isUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isNull(): bool(false) +V8\ObjectValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isTrue(): bool(false) +V8\ObjectValue(V8\Value)->isFalse(): bool(false) +V8\ObjectValue(V8\Value)->isName(): bool(false) +V8\ObjectValue(V8\Value)->isString(): bool(false) +V8\ObjectValue(V8\Value)->isSymbol(): bool(false) +V8\ObjectValue(V8\Value)->isFunction(): bool(false) +V8\ObjectValue(V8\Value)->isArray(): bool(false) +V8\ObjectValue(V8\Value)->isObject(): bool(true) +V8\ObjectValue(V8\Value)->isBoolean(): bool(false) +V8\ObjectValue(V8\Value)->isNumber(): bool(false) +V8\ObjectValue(V8\Value)->isInt32(): bool(false) +V8\ObjectValue(V8\Value)->isUint32(): bool(false) +V8\ObjectValue(V8\Value)->isDate(): bool(false) +V8\ObjectValue(V8\Value)->isArgumentsObject(): bool(false) +V8\ObjectValue(V8\Value)->isBooleanObject(): bool(false) +V8\ObjectValue(V8\Value)->isNumberObject(): bool(false) +V8\ObjectValue(V8\Value)->isStringObject(): bool(false) +V8\ObjectValue(V8\Value)->isSymbolObject(): bool(false) +V8\ObjectValue(V8\Value)->isNativeError(): bool(true) +V8\ObjectValue(V8\Value)->isRegExp(): bool(false) +V8\ObjectValue(V8\Value)->isAsyncFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorObject(): bool(false) +V8\ObjectValue(V8\Value)->isPromise(): bool(false) +V8\ObjectValue(V8\Value)->isMap(): bool(false) +V8\ObjectValue(V8\Value)->isSet(): bool(false) +V8\ObjectValue(V8\Value)->isMapIterator(): bool(false) +V8\ObjectValue(V8\Value)->isSetIterator(): bool(false) +V8\ObjectValue(V8\Value)->isWeakMap(): bool(false) +V8\ObjectValue(V8\Value)->isWeakSet(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBufferView(): bool(false) +V8\ObjectValue(V8\Value)->isTypedArray(): bool(false) +V8\ObjectValue(V8\Value)->isUint8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\ObjectValue(V8\Value)->isInt8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint16Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt16Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint32Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat64Array(): bool(false) +V8\ObjectValue(V8\Value)->isDataView(): bool(false) +V8\ObjectValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isProxy(): bool(false) diff --git a/tests/V8Exception_GetStackTrace.phpt b/tests/V8Exception_getStackTrace.phpt similarity index 82% rename from tests/V8Exception_GetStackTrace.phpt rename to tests/V8Exception_getStackTrace.phpt index 67de804..6bded6b 100644 --- a/tests/V8Exception_GetStackTrace.phpt +++ b/tests/V8Exception_getStackTrace.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\Exception::GetStackTrace() +V8\Exception::getStackTrace() --SKIPIF-- --FILE-- @@ -14,7 +14,7 @@ $context = new \V8\Context($isolate); try { - $stack_trace = V8\Exception::GetStackTrace($context, new \V8\StringValue($isolate, 'test')); + $stack_trace = V8\Exception::getStackTrace($context, new \V8\StringValue($isolate, 'test')); $helper->assert('Can get stack trace when out of context', true); } catch (\Exception $e) { $helper->exception_export($e); @@ -26,36 +26,36 @@ $helper->line(); //$isolate->SetCaptureStackTraceForUncaughtExceptions($stack_trace_generation_allowed); // actually, this is default behavior $func_test_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper, $v8_helper, &$stack_trace_generation_allowed) { - $isolate = $info->GetIsolate(); + $isolate = $info->getIsolate(); - $helper->assert('Exception passed', count($info->Arguments()) == 1); + $helper->assert('Exception passed', count($info->arguments()) == 1); $helper->line(); - $exception = $info->Arguments()[0]; + $exception = $info->arguments()[0]; if (!$stack_trace_generation_allowed) { - $stack_trace = V8\Exception::GetStackTrace($info->GetContext(), $exception); + $stack_trace = V8\Exception::getStackTrace($info->getContext(), $exception); $helper->assert('Stack trace created from thrown value is null when capturing stack trace disabled', $stack_trace === null); $helper->line(); return; } - $stack_trace = V8\Exception::GetStackTrace($info->GetContext(), $exception); + $stack_trace = V8\Exception::getStackTrace($info->getContext(), $exception); $helper->header('Stack trace created from thrown value'); - $helper->dump_object_methods($stack_trace, [], new ArrayListFilter(['GetFrame'], true, ReflectionMethod::IS_PUBLIC)); + $helper->dump_object_methods($stack_trace, [], new ArrayListFilter(['getFrame'], true, ReflectionMethod::IS_PUBLIC)); $helper->line(); - $exception = new \V8\StringValue($info->GetIsolate(), 'test'); - $stack_trace = V8\Exception::GetStackTrace($info->GetContext(), $exception); + $exception = new \V8\StringValue($info->getIsolate(), 'test'); + $stack_trace = V8\Exception::getStackTrace($info->getContext(), $exception); $helper->assert('Stack trace created from manually created value is null', null === $stack_trace); $helper->line(); }); $global_tpl = new \V8\ObjectTemplate($isolate); -$global_tpl->Set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); +$global_tpl->set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); $context = new \V8\Context($isolate, $global_tpl); $v8_helper->injectConsoleLog($context); @@ -83,7 +83,7 @@ $res = $v8_helper->CompileRun($context, $source); $helper->line(); $stack_trace_generation_allowed = true; -$isolate->SetCaptureStackTraceForUncaughtExceptions($stack_trace_generation_allowed); +$isolate->setCaptureStackTraceForUncaughtExceptions($stack_trace_generation_allowed); $res = $v8_helper->CompileRun($context, $source); @@ -133,6 +133,6 @@ V8\StackTrace->getFrames(): bool(false) } } -V8\StackTrace->GetFrameCount(): int(1) +V8\StackTrace->getFrameCount(): int(1) Stack trace created from manually created value is null: ok diff --git a/tests/V8Exception_rangeError.phpt b/tests/V8Exception_rangeError.phpt new file mode 100644 index 0000000..e74ba3e --- /dev/null +++ b/tests/V8Exception_rangeError.phpt @@ -0,0 +1,155 @@ +--TEST-- +V8\Exception::rangeError() +--SKIPIF-- + +--FILE-- +assert('Can create error when out of context', $error instanceof \V8\Value); +} catch (\Exception $e) { + $helper->exception_export($e); +} + +$helper->line(); + +$func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) { + $value = count($info->arguments()) ? $info->arguments()[0] : new \V8\StringValue($info->getIsolate(), "exception"); + + $info->getIsolate()->throwException($info->getContext(), V8\Exception::rangeError($info->getContext(), $value)); +}); + +$func_test_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper, $v8_helper) { + + $message = new \V8\StringValue($info->getIsolate(), "test"); + $value1 = V8\Exception::rangeError($info->getContext(), $message); + $value2 = V8\Exception::rangeError($info->getContext(), $message); + + $context = $info->getContext(); + + $v8_helper->CHECK_NE($value1, $value2); + $v8_helper->CHECK(!$value1->equals($context, $value2), '!$value1->equals($context, $value2)'); + $v8_helper->CHECK(!$value2->equals($context, $value1), '!$value2->equals($context, $value1)'); + + $v8_helper->CHECK(!$value1->strictEquals($value2), '!$value1->strictEquals($value2)'); + $v8_helper->CHECK(!$value2->strictEquals($value1), '!$value2->strictEquals($value1)'); + + $v8_helper->CHECK(!$value1->sameValue($value2), '!$value1->sameValue($value2)'); + $v8_helper->CHECK(!$value2->sameValue($value1), '!$value2->sameValue($value1)'); + + $helper->line(); +}); + +$global_tpl = new \V8\ObjectTemplate($isolate); +$global_tpl->set(new \V8\StringValue($isolate, 'e'), $func_tpl); +$global_tpl->set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); + +$context = new \V8\Context($isolate, $global_tpl); +$v8_helper->injectConsoleLog($context); + +$v8_helper->CompileTryRun($context, 'test()'); +$v8_helper->CompileTryRun($context, 'e()'); +$v8_helper->CompileTryRun($context, 'e("test")'); + +$source = ' + var ex; + + try { + e("foo"); + } catch (exception) { + console.log("exception: ", "\'", exception, "\'"); + console.log("exception.stack: ", exception.stack); + ex = exception; + } + + ex +'; + +$helper->line(); + +$res = $v8_helper->CompileRun($context, $source); +$helper->line(); + +$v8_helper->run_checks($res); +?> +--EXPECT-- +Can create error when out of context: ok + +CHECK_NE: OK +CHECK !$value1->equals($context, $value2): OK +CHECK !$value2->equals($context, $value1): OK +CHECK !$value1->strictEquals($value2): OK +CHECK !$value2->strictEquals($value1): OK +CHECK !$value1->sameValue($value2): OK +CHECK !$value2->sameValue($value1): OK + +e(): V8\Exceptions\TryCatchException: RangeError: exception +e("test"): V8\Exceptions\TryCatchException: RangeError: test + +exception: 'RangeError: foo' +exception.stack: RangeError: foo + at test.js:5:9 + +Checks on V8\ObjectValue: +------------------------- +V8\ObjectValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\ObjectValue->isCallable(): bool(false) +V8\ObjectValue->isConstructor(): bool(false) +V8\ObjectValue(V8\Value)->isUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isNull(): bool(false) +V8\ObjectValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isTrue(): bool(false) +V8\ObjectValue(V8\Value)->isFalse(): bool(false) +V8\ObjectValue(V8\Value)->isName(): bool(false) +V8\ObjectValue(V8\Value)->isString(): bool(false) +V8\ObjectValue(V8\Value)->isSymbol(): bool(false) +V8\ObjectValue(V8\Value)->isFunction(): bool(false) +V8\ObjectValue(V8\Value)->isArray(): bool(false) +V8\ObjectValue(V8\Value)->isObject(): bool(true) +V8\ObjectValue(V8\Value)->isBoolean(): bool(false) +V8\ObjectValue(V8\Value)->isNumber(): bool(false) +V8\ObjectValue(V8\Value)->isInt32(): bool(false) +V8\ObjectValue(V8\Value)->isUint32(): bool(false) +V8\ObjectValue(V8\Value)->isDate(): bool(false) +V8\ObjectValue(V8\Value)->isArgumentsObject(): bool(false) +V8\ObjectValue(V8\Value)->isBooleanObject(): bool(false) +V8\ObjectValue(V8\Value)->isNumberObject(): bool(false) +V8\ObjectValue(V8\Value)->isStringObject(): bool(false) +V8\ObjectValue(V8\Value)->isSymbolObject(): bool(false) +V8\ObjectValue(V8\Value)->isNativeError(): bool(true) +V8\ObjectValue(V8\Value)->isRegExp(): bool(false) +V8\ObjectValue(V8\Value)->isAsyncFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorObject(): bool(false) +V8\ObjectValue(V8\Value)->isPromise(): bool(false) +V8\ObjectValue(V8\Value)->isMap(): bool(false) +V8\ObjectValue(V8\Value)->isSet(): bool(false) +V8\ObjectValue(V8\Value)->isMapIterator(): bool(false) +V8\ObjectValue(V8\Value)->isSetIterator(): bool(false) +V8\ObjectValue(V8\Value)->isWeakMap(): bool(false) +V8\ObjectValue(V8\Value)->isWeakSet(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBufferView(): bool(false) +V8\ObjectValue(V8\Value)->isTypedArray(): bool(false) +V8\ObjectValue(V8\Value)->isUint8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\ObjectValue(V8\Value)->isInt8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint16Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt16Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint32Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat64Array(): bool(false) +V8\ObjectValue(V8\Value)->isDataView(): bool(false) +V8\ObjectValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isProxy(): bool(false) diff --git a/tests/V8Exception_referenceError.phpt b/tests/V8Exception_referenceError.phpt new file mode 100644 index 0000000..45662b8 --- /dev/null +++ b/tests/V8Exception_referenceError.phpt @@ -0,0 +1,155 @@ +--TEST-- +V8\Exception::referenceError() +--SKIPIF-- + +--FILE-- +assert('Can create error when out of context', $error instanceof \V8\Value); +} catch (\Exception $e) { + $helper->exception_export($e); +} + +$helper->line(); + +$func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) { + $value = count($info->arguments()) ? $info->arguments()[0] : new \V8\StringValue($info->getIsolate(), "exception"); + + $info->getIsolate()->throwException($info->getContext(), V8\Exception::referenceError($info->getContext(), $value)); +}); + +$func_test_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper, $v8_helper) { + + $message = new \V8\StringValue($info->getIsolate(), "test"); + $value1 = V8\Exception::referenceError($info->getContext(), $message); + $value2 = V8\Exception::referenceError($info->getContext(), $message); + + $context = $info->getContext(); + + $v8_helper->CHECK_NE($value1, $value2); + $v8_helper->CHECK(!$value1->equals($context, $value2), '!$value1->equals($context, $value2)'); + $v8_helper->CHECK(!$value2->equals($context, $value1), '!$value2->equals($context, $value1)'); + + $v8_helper->CHECK(!$value1->strictEquals($value2), '!$value1->strictEquals($value2)'); + $v8_helper->CHECK(!$value2->strictEquals($value1), '!$value2->strictEquals($value1)'); + + $v8_helper->CHECK(!$value1->sameValue($value2), '!$value1->sameValue($value2)'); + $v8_helper->CHECK(!$value2->sameValue($value1), '!$value2->sameValue($value1)'); + + $helper->line(); +}); + +$global_tpl = new \V8\ObjectTemplate($isolate); +$global_tpl->set(new \V8\StringValue($isolate, 'e'), $func_tpl); +$global_tpl->set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); + +$context = new \V8\Context($isolate, $global_tpl); +$v8_helper->injectConsoleLog($context); + +$v8_helper->CompileTryRun($context, 'test()'); +$v8_helper->CompileTryRun($context, 'e()'); +$v8_helper->CompileTryRun($context, 'e("test")'); + +$source = ' + var ex; + + try { + e("foo"); + } catch (exception) { + console.log("exception: ", "\'", exception, "\'"); + console.log("exception.stack: ", exception.stack); + ex = exception; + } + + ex +'; + +$helper->line(); + +$res = $v8_helper->CompileRun($context, $source); +$helper->line(); + +$v8_helper->run_checks($res); +?> +--EXPECT-- +Can create error when out of context: ok + +CHECK_NE: OK +CHECK !$value1->equals($context, $value2): OK +CHECK !$value2->equals($context, $value1): OK +CHECK !$value1->strictEquals($value2): OK +CHECK !$value2->strictEquals($value1): OK +CHECK !$value1->sameValue($value2): OK +CHECK !$value2->sameValue($value1): OK + +e(): V8\Exceptions\TryCatchException: ReferenceError: exception +e("test"): V8\Exceptions\TryCatchException: ReferenceError: test + +exception: 'ReferenceError: foo' +exception.stack: ReferenceError: foo + at test.js:5:9 + +Checks on V8\ObjectValue: +------------------------- +V8\ObjectValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\ObjectValue->isCallable(): bool(false) +V8\ObjectValue->isConstructor(): bool(false) +V8\ObjectValue(V8\Value)->isUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isNull(): bool(false) +V8\ObjectValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isTrue(): bool(false) +V8\ObjectValue(V8\Value)->isFalse(): bool(false) +V8\ObjectValue(V8\Value)->isName(): bool(false) +V8\ObjectValue(V8\Value)->isString(): bool(false) +V8\ObjectValue(V8\Value)->isSymbol(): bool(false) +V8\ObjectValue(V8\Value)->isFunction(): bool(false) +V8\ObjectValue(V8\Value)->isArray(): bool(false) +V8\ObjectValue(V8\Value)->isObject(): bool(true) +V8\ObjectValue(V8\Value)->isBoolean(): bool(false) +V8\ObjectValue(V8\Value)->isNumber(): bool(false) +V8\ObjectValue(V8\Value)->isInt32(): bool(false) +V8\ObjectValue(V8\Value)->isUint32(): bool(false) +V8\ObjectValue(V8\Value)->isDate(): bool(false) +V8\ObjectValue(V8\Value)->isArgumentsObject(): bool(false) +V8\ObjectValue(V8\Value)->isBooleanObject(): bool(false) +V8\ObjectValue(V8\Value)->isNumberObject(): bool(false) +V8\ObjectValue(V8\Value)->isStringObject(): bool(false) +V8\ObjectValue(V8\Value)->isSymbolObject(): bool(false) +V8\ObjectValue(V8\Value)->isNativeError(): bool(true) +V8\ObjectValue(V8\Value)->isRegExp(): bool(false) +V8\ObjectValue(V8\Value)->isAsyncFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorObject(): bool(false) +V8\ObjectValue(V8\Value)->isPromise(): bool(false) +V8\ObjectValue(V8\Value)->isMap(): bool(false) +V8\ObjectValue(V8\Value)->isSet(): bool(false) +V8\ObjectValue(V8\Value)->isMapIterator(): bool(false) +V8\ObjectValue(V8\Value)->isSetIterator(): bool(false) +V8\ObjectValue(V8\Value)->isWeakMap(): bool(false) +V8\ObjectValue(V8\Value)->isWeakSet(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBufferView(): bool(false) +V8\ObjectValue(V8\Value)->isTypedArray(): bool(false) +V8\ObjectValue(V8\Value)->isUint8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\ObjectValue(V8\Value)->isInt8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint16Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt16Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint32Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat64Array(): bool(false) +V8\ObjectValue(V8\Value)->isDataView(): bool(false) +V8\ObjectValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isProxy(): bool(false) diff --git a/tests/V8Exception_syntaxError.phpt b/tests/V8Exception_syntaxError.phpt new file mode 100644 index 0000000..bb85f3f --- /dev/null +++ b/tests/V8Exception_syntaxError.phpt @@ -0,0 +1,155 @@ +--TEST-- +V8\Exception::syntaxError() +--SKIPIF-- + +--FILE-- +assert('Can create error when out of context', $error instanceof \V8\Value); +} catch (\Exception $e) { + $helper->exception_export($e); +} + +$helper->line(); + +$func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) { + $value = count($info->arguments()) ? $info->arguments()[0] : new \V8\StringValue($info->getIsolate(), "exception"); + + $info->getIsolate()->throwException($info->getContext(), V8\Exception::syntaxError($info->getContext(), $value)); +}); + +$func_test_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper, $v8_helper) { + + $message = new \V8\StringValue($info->getIsolate(), "test"); + $value1 = V8\Exception::syntaxError($info->getContext(), $message); + $value2 = V8\Exception::syntaxError($info->getContext(), $message); + + $context = $info->getContext(); + + $v8_helper->CHECK_NE($value1, $value2); + $v8_helper->CHECK(!$value1->equals($context, $value2), '!$value1->equals($context, $value2)'); + $v8_helper->CHECK(!$value2->equals($context, $value1), '!$value2->equals($context, $value1)'); + + $v8_helper->CHECK(!$value1->strictEquals($value2), '!$value1->strictEquals($value2)'); + $v8_helper->CHECK(!$value2->strictEquals($value1), '!$value2->strictEquals($value1)'); + + $v8_helper->CHECK(!$value1->sameValue($value2), '!$value1->sameValue($value2)'); + $v8_helper->CHECK(!$value2->sameValue($value1), '!$value2->sameValue($value1)'); + + $helper->line(); +}); + +$global_tpl = new \V8\ObjectTemplate($isolate); +$global_tpl->set(new \V8\StringValue($isolate, 'e'), $func_tpl); +$global_tpl->set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); + +$context = new \V8\Context($isolate, $global_tpl); +$v8_helper->injectConsoleLog($context); + +$v8_helper->CompileTryRun($context, 'test()'); +$v8_helper->CompileTryRun($context, 'e()'); +$v8_helper->CompileTryRun($context, 'e("test")'); + +$source = ' + var ex; + + try { + e("foo"); + } catch (exception) { + console.log("exception: ", "\'", exception, "\'"); + console.log("exception.stack: ", exception.stack); + ex = exception; + } + + ex +'; + +$helper->line(); + +$res = $v8_helper->CompileRun($context, $source); +$helper->line(); + +$v8_helper->run_checks($res); +?> +--EXPECT-- +Can create error when out of context: ok + +CHECK_NE: OK +CHECK !$value1->equals($context, $value2): OK +CHECK !$value2->equals($context, $value1): OK +CHECK !$value1->strictEquals($value2): OK +CHECK !$value2->strictEquals($value1): OK +CHECK !$value1->sameValue($value2): OK +CHECK !$value2->sameValue($value1): OK + +e(): V8\Exceptions\TryCatchException: SyntaxError: exception +e("test"): V8\Exceptions\TryCatchException: SyntaxError: test + +exception: 'SyntaxError: foo' +exception.stack: SyntaxError: foo + at test.js:5:9 + +Checks on V8\ObjectValue: +------------------------- +V8\ObjectValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\ObjectValue->isCallable(): bool(false) +V8\ObjectValue->isConstructor(): bool(false) +V8\ObjectValue(V8\Value)->isUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isNull(): bool(false) +V8\ObjectValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isTrue(): bool(false) +V8\ObjectValue(V8\Value)->isFalse(): bool(false) +V8\ObjectValue(V8\Value)->isName(): bool(false) +V8\ObjectValue(V8\Value)->isString(): bool(false) +V8\ObjectValue(V8\Value)->isSymbol(): bool(false) +V8\ObjectValue(V8\Value)->isFunction(): bool(false) +V8\ObjectValue(V8\Value)->isArray(): bool(false) +V8\ObjectValue(V8\Value)->isObject(): bool(true) +V8\ObjectValue(V8\Value)->isBoolean(): bool(false) +V8\ObjectValue(V8\Value)->isNumber(): bool(false) +V8\ObjectValue(V8\Value)->isInt32(): bool(false) +V8\ObjectValue(V8\Value)->isUint32(): bool(false) +V8\ObjectValue(V8\Value)->isDate(): bool(false) +V8\ObjectValue(V8\Value)->isArgumentsObject(): bool(false) +V8\ObjectValue(V8\Value)->isBooleanObject(): bool(false) +V8\ObjectValue(V8\Value)->isNumberObject(): bool(false) +V8\ObjectValue(V8\Value)->isStringObject(): bool(false) +V8\ObjectValue(V8\Value)->isSymbolObject(): bool(false) +V8\ObjectValue(V8\Value)->isNativeError(): bool(true) +V8\ObjectValue(V8\Value)->isRegExp(): bool(false) +V8\ObjectValue(V8\Value)->isAsyncFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorObject(): bool(false) +V8\ObjectValue(V8\Value)->isPromise(): bool(false) +V8\ObjectValue(V8\Value)->isMap(): bool(false) +V8\ObjectValue(V8\Value)->isSet(): bool(false) +V8\ObjectValue(V8\Value)->isMapIterator(): bool(false) +V8\ObjectValue(V8\Value)->isSetIterator(): bool(false) +V8\ObjectValue(V8\Value)->isWeakMap(): bool(false) +V8\ObjectValue(V8\Value)->isWeakSet(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBufferView(): bool(false) +V8\ObjectValue(V8\Value)->isTypedArray(): bool(false) +V8\ObjectValue(V8\Value)->isUint8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\ObjectValue(V8\Value)->isInt8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint16Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt16Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint32Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat64Array(): bool(false) +V8\ObjectValue(V8\Value)->isDataView(): bool(false) +V8\ObjectValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isProxy(): bool(false) diff --git a/tests/V8Exception_typeError.phpt b/tests/V8Exception_typeError.phpt new file mode 100644 index 0000000..b102109 --- /dev/null +++ b/tests/V8Exception_typeError.phpt @@ -0,0 +1,155 @@ +--TEST-- +V8\Exception::typeError() +--SKIPIF-- + +--FILE-- +assert('Can create error when out of context', $error instanceof \V8\Value); +} catch (\Exception $e) { + $helper->exception_export($e); +} + +$helper->line(); + +$func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) { + $value = count($info->arguments()) ? $info->arguments()[0] : new \V8\StringValue($info->getIsolate(), "exception"); + + $info->getIsolate()->throwException($info->getContext(), V8\Exception::typeError($info->getContext(), $value)); +}); + +$func_test_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper, $v8_helper) { + + $message = new \V8\StringValue($info->getIsolate(), "test"); + $value1 = V8\Exception::typeError($info->getContext(), $message); + $value2 = V8\Exception::typeError($info->getContext(), $message); + + $context = $info->getContext(); + + $v8_helper->CHECK_NE($value1, $value2); + $v8_helper->CHECK(!$value1->equals($context, $value2), '!$value1->equals($context, $value2)'); + $v8_helper->CHECK(!$value2->equals($context, $value1), '!$value2->equals($context, $value1)'); + + $v8_helper->CHECK(!$value1->strictEquals($value2), '!$value1->strictEquals($value2)'); + $v8_helper->CHECK(!$value2->strictEquals($value1), '!$value2->strictEquals($value1)'); + + $v8_helper->CHECK(!$value1->sameValue($value2), '!$value1->sameValue($value2)'); + $v8_helper->CHECK(!$value2->sameValue($value1), '!$value2->sameValue($value1)'); + + $helper->line(); +}); + +$global_tpl = new \V8\ObjectTemplate($isolate); +$global_tpl->set(new \V8\StringValue($isolate, 'e'), $func_tpl); +$global_tpl->set(new \V8\StringValue($isolate, 'test'), $func_test_tpl); + +$context = new \V8\Context($isolate, $global_tpl); +$v8_helper->injectConsoleLog($context); + +$v8_helper->CompileTryRun($context, 'test()'); +$v8_helper->CompileTryRun($context, 'e()'); +$v8_helper->CompileTryRun($context, 'e("test")'); + +$source = ' + var ex; + + try { + e("foo"); + } catch (exception) { + console.log("exception: ", "\'", exception, "\'"); + console.log("exception.stack: ", exception.stack); + ex = exception; + } + + ex +'; + +$helper->line(); + +$res = $v8_helper->CompileRun($context, $source); +$helper->line(); + +$v8_helper->run_checks($res); +?> +--EXPECT-- +Can create error when out of context: ok + +CHECK_NE: OK +CHECK !$value1->equals($context, $value2): OK +CHECK !$value2->equals($context, $value1): OK +CHECK !$value1->strictEquals($value2): OK +CHECK !$value2->strictEquals($value1): OK +CHECK !$value1->sameValue($value2): OK +CHECK !$value2->sameValue($value1): OK + +e(): V8\Exceptions\TryCatchException: TypeError: exception +e("test"): V8\Exceptions\TryCatchException: TypeError: test + +exception: 'TypeError: foo' +exception.stack: TypeError: foo + at test.js:5:9 + +Checks on V8\ObjectValue: +------------------------- +V8\ObjectValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\ObjectValue->isCallable(): bool(false) +V8\ObjectValue->isConstructor(): bool(false) +V8\ObjectValue(V8\Value)->isUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isNull(): bool(false) +V8\ObjectValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isTrue(): bool(false) +V8\ObjectValue(V8\Value)->isFalse(): bool(false) +V8\ObjectValue(V8\Value)->isName(): bool(false) +V8\ObjectValue(V8\Value)->isString(): bool(false) +V8\ObjectValue(V8\Value)->isSymbol(): bool(false) +V8\ObjectValue(V8\Value)->isFunction(): bool(false) +V8\ObjectValue(V8\Value)->isArray(): bool(false) +V8\ObjectValue(V8\Value)->isObject(): bool(true) +V8\ObjectValue(V8\Value)->isBoolean(): bool(false) +V8\ObjectValue(V8\Value)->isNumber(): bool(false) +V8\ObjectValue(V8\Value)->isInt32(): bool(false) +V8\ObjectValue(V8\Value)->isUint32(): bool(false) +V8\ObjectValue(V8\Value)->isDate(): bool(false) +V8\ObjectValue(V8\Value)->isArgumentsObject(): bool(false) +V8\ObjectValue(V8\Value)->isBooleanObject(): bool(false) +V8\ObjectValue(V8\Value)->isNumberObject(): bool(false) +V8\ObjectValue(V8\Value)->isStringObject(): bool(false) +V8\ObjectValue(V8\Value)->isSymbolObject(): bool(false) +V8\ObjectValue(V8\Value)->isNativeError(): bool(true) +V8\ObjectValue(V8\Value)->isRegExp(): bool(false) +V8\ObjectValue(V8\Value)->isAsyncFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorObject(): bool(false) +V8\ObjectValue(V8\Value)->isPromise(): bool(false) +V8\ObjectValue(V8\Value)->isMap(): bool(false) +V8\ObjectValue(V8\Value)->isSet(): bool(false) +V8\ObjectValue(V8\Value)->isMapIterator(): bool(false) +V8\ObjectValue(V8\Value)->isSetIterator(): bool(false) +V8\ObjectValue(V8\Value)->isWeakMap(): bool(false) +V8\ObjectValue(V8\Value)->isWeakSet(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBufferView(): bool(false) +V8\ObjectValue(V8\Value)->isTypedArray(): bool(false) +V8\ObjectValue(V8\Value)->isUint8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\ObjectValue(V8\Value)->isInt8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint16Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt16Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint32Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat64Array(): bool(false) +V8\ObjectValue(V8\Value)->isDataView(): bool(false) +V8\ObjectValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isProxy(): bool(false) diff --git a/tests/V8ExceptionsTryCatchException.phpt b/tests/V8ExceptionsTryCatchException.phpt index 78d35d3..5531dd0 100644 --- a/tests/V8ExceptionsTryCatchException.phpt +++ b/tests/V8ExceptionsTryCatchException.phpt @@ -21,9 +21,9 @@ $helper->dump($value); $helper->space(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_matches($value, 'GetContext', $context); -$helper->method_matches($value, 'GetTryCatch', $try_catch); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_matches($value, 'getContext', $context); +$helper->method_matches($value, 'getTryCatch', $try_catch); $helper->space(); // EXPECTF: ---/string\(.+\) ".+\/V8ExceptionsTryCatchException\.php"/ @@ -86,6 +86,6 @@ object(V8\Exceptions\TryCatchException)#5 (10) { Accessors: ---------- -V8\Exceptions\TryCatchException::GetIsolate() matches expected value -V8\Exceptions\TryCatchException::GetContext() matches expected value -V8\Exceptions\TryCatchException::GetTryCatch() matches expected value +V8\Exceptions\TryCatchException::getIsolate() matches expected value +V8\Exceptions\TryCatchException::getContext() matches expected value +V8\Exceptions\TryCatchException::getTryCatch() matches expected value diff --git a/tests/V8FunctionCallbackInfo.phpt b/tests/V8FunctionCallbackInfo.phpt index b2be3af..e00f8db 100644 --- a/tests/V8FunctionCallbackInfo.phpt +++ b/tests/V8FunctionCallbackInfo.phpt @@ -32,19 +32,19 @@ $func = new v8Tests\TrackingDtors\FunctionObject($context, function (V8\Function $helper->space(); $callback_info = $info; - $helper->assert('Original arguments number passed', count($info->Arguments()) == 2); - $helper->assert('Arguments number matches Length() method output', count($info->Arguments()) == $info->Length()); + $helper->assert('Original arguments number passed', count($info->arguments()) == 2); + $helper->assert('Arguments number matches Length() method output', count($info->arguments()) == $info->length()); - $helper->assert('Callback info holds original isolate object', $info->GetIsolate(), $isolate); - $helper->assert('Callback info holds original isolate object', $info->GetContext(), $context); + $helper->assert('Callback info holds original isolate object', $info->getIsolate(), $isolate); + $helper->assert('Callback info holds original isolate object', $info->getContext(), $context); - $helper->assert('Scalars hold no info about their zval, so that their zvals are recreated on each access', $scalar !== $info->Arguments()[0]); - $helper->assert("Objects can hold info about their zval and keep it until zval's get free() ", $object === $info->Arguments()[1]); + $helper->assert('Scalars hold no info about their zval, so that their zvals are recreated on each access', $scalar !== $info->arguments()[0]); + $helper->assert("Objects can hold info about their zval and keep it until zval's get free() ", $object === $info->arguments()[1]); }); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'print'), $func); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'scalar'), $scalar); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'obj'), $object); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'print'), $func); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'scalar'), $scalar); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'obj'), $object); $source = 'print(scalar, obj); "Script done";'; $file_name = 'test.js'; @@ -52,12 +52,12 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$helper->dump($script->Run($context)->ToString($context)->Value()); +$helper->dump($script->run($context)->toString($context)->value()); $helper->space(); //try { -$retval = $callback_info->GetReturnValue(); +$retval = $callback_info->getReturnValue(); $helper->dump($retval); //} catch (Exception $e) { // $helper->exception_export($e); diff --git a/tests/V8FunctionObject.phpt b/tests/V8FunctionObject.phpt index ae24531..482ebf9 100644 --- a/tests/V8FunctionObject.phpt +++ b/tests/V8FunctionObject.phpt @@ -24,7 +24,7 @@ $func = new v8Tests\TrackingDtors\FunctionObject($context, function (\V8\Functio echo 'Should output Hello World string', PHP_EOL; }); -$func->SetName(new \V8\StringValue($isolate, 'custom_name')); +$func->setName(new \V8\StringValue($isolate, 'custom_name')); $helper->header('Object representation'); $helper->dump($func); @@ -32,12 +32,12 @@ $helper->space(); $helper->assert('FunctionObject extends ObjectValue', $func instanceof \V8\ObjectValue); $helper->assert('FunctionObject implements AdjustableExternalMemoryInterface', $func instanceof \V8\AdjustableExternalMemoryInterface); -$helper->assert('FunctionObject is instanceof Function', $func->InstanceOf($context, $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'Function')))); +$helper->assert('FunctionObject is instanceof Function', $func->instanceOf($context, $context->globalObject()->get($context, new \V8\StringValue($isolate, 'Function')))); $helper->line(); $v8_helper->run_checks($func, 'Checkers'); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'print'), $func); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'print'), $func); $source = 'print("Hello, world"); delete print; "Script done"'; $file_name = 'test.js'; @@ -45,10 +45,10 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$helper->dump($script->Run($context)->ToString($context)->Value()); +$helper->dump($script->run($context)->toString($context)->value()); $helper->line(); -$helper->dump_object_methods($func, [], new ArrayMapFilter(['GetScriptOrigin' => true])); +$helper->dump_object_methods($func, [], new ArrayMapFilter(['getScriptOrigin' => true])); $helper->line(); echo 'We are done for now', PHP_EOL; @@ -76,64 +76,64 @@ FunctionObject is instanceof Function: ok Checkers: --------- -v8Tests\TrackingDtors\FunctionObject(V8\Value)->TypeOf(): V8\StringValue->Value(): string(8) "function" - -v8Tests\TrackingDtors\FunctionObject(V8\ObjectValue)->IsCallable(): bool(true) -v8Tests\TrackingDtors\FunctionObject(V8\ObjectValue)->IsConstructor(): bool(true) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsUndefined(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsNull(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsNullOrUndefined(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsTrue(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsFalse(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsName(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsString(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsSymbol(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsFunction(): bool(true) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsArray(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsObject(): bool(true) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsBoolean(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsNumber(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsInt32(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsUint32(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsDate(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsArgumentsObject(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsBooleanObject(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsNumberObject(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsStringObject(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsSymbolObject(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsNativeError(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsRegExp(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsAsyncFunction(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsGeneratorFunction(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsGeneratorObject(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsPromise(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsMap(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsSet(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsMapIterator(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsSetIterator(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsWeakMap(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsWeakSet(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsArrayBuffer(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsArrayBufferView(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsTypedArray(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsUint8Array(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsUint8ClampedArray(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsInt8Array(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsUint16Array(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsInt16Array(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsUint32Array(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsInt32Array(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsFloat32Array(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsFloat64Array(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsDataView(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsSharedArrayBuffer(): bool(false) -v8Tests\TrackingDtors\FunctionObject(V8\Value)->IsProxy(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->typeOf(): V8\StringValue->value(): string(8) "function" + +v8Tests\TrackingDtors\FunctionObject(V8\ObjectValue)->isCallable(): bool(true) +v8Tests\TrackingDtors\FunctionObject(V8\ObjectValue)->isConstructor(): bool(true) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isUndefined(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isNull(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isNullOrUndefined(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isTrue(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isFalse(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isName(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isString(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isSymbol(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isFunction(): bool(true) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isArray(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isObject(): bool(true) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isBoolean(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isNumber(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isInt32(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isUint32(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isDate(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isArgumentsObject(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isBooleanObject(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isNumberObject(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isStringObject(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isSymbolObject(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isNativeError(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isRegExp(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isAsyncFunction(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isGeneratorFunction(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isGeneratorObject(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isPromise(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isMap(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isSet(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isMapIterator(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isSetIterator(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isWeakMap(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isWeakSet(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isArrayBuffer(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isArrayBufferView(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isTypedArray(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isUint8Array(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isUint8ClampedArray(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isInt8Array(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isUint16Array(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isInt16Array(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isUint32Array(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isInt32Array(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isFloat32Array(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isFloat64Array(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isDataView(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isSharedArrayBuffer(): bool(false) +v8Tests\TrackingDtors\FunctionObject(V8\Value)->isProxy(): bool(false) Should output Hello World string string(11) "Script done" -v8Tests\TrackingDtors\FunctionObject(V8\FunctionObject)->GetScriptOrigin(): +v8Tests\TrackingDtors\FunctionObject(V8\FunctionObject)->getScriptOrigin(): object(V8\ScriptOrigin)#128 (6) { ["resource_name":"V8\ScriptOrigin":private]=> string(0) "" diff --git a/tests/V8FunctionObject_Call.phpt b/tests/V8FunctionObject_Call.phpt deleted file mode 100644 index d2024df..0000000 --- a/tests/V8FunctionObject_Call.phpt +++ /dev/null @@ -1,234 +0,0 @@ ---TEST-- -V8\FunctionObject::Call() ---SKIPIF-- - ---FILE-- -GetIsolate(); -// v8::HandleScope scope(isolate); - -$isolate = new \V8\Isolate(); -$context = new \V8\Context($isolate); - -// CompileRun( -// "function Foo() {" -// " var result = [];" -// " for (var i = 0; i < arguments.length; i++) {" -// " result.push(arguments[i]);" -// " }" -// " return result;" -// "}" -// "function ReturnThisSloppy() {" -// " return this;" -// "}" -// "function ReturnThisStrict() {" -// " 'use strict';" -// " return this;" -// "}"); - -$v8_helper->CompileRun( - $context, "" - . "function Foo() {" - . " var result = [];" - . " for (var i = 0; i < arguments.length; i++) {" - . " result.push(arguments[i]);" - . " }" - . " return result;" - . "}" - . "function ReturnThisSloppy() {" - . " return this;" - . "}" - . "function ReturnThisStrict() {" - . " 'use strict';" - . " return this;" - . "}" -); - -// Local Foo = Local::Cast(context->Global()->Get(v8_str("Foo"))); -$Foo = $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'Foo')); - -// Local ReturnThisSloppy = Local::Cast(context->Global()->Get(v8_str("ReturnThisSloppy"))); -$ReturnThisSloppy = $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'ReturnThisSloppy')); - -// Local ReturnThisStrict = Local::Cast(context->Global()->Get(v8_str("ReturnThisStrict"))); -$ReturnThisStrict = $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'ReturnThisStrict')); - -// v8::Handle* args0 = NULL; -$args0 = []; -// Local a0 = Local::Cast(Foo->Call(Foo, 0, args0)); -$a0 = $Foo->Call($context, $Foo, $args0); -// CHECK_EQ(0u, a0->Length()); -$v8_helper->CHECK_EQ(0, $a0->Length(), '0, $a0->Length()'); -$helper->line(); - -// v8::Handle args1[] = {v8_num(1.1)}; -$args1 = [new \V8\NumberValue($isolate, 1.1)]; -// Local a1 = Local::Cast(Foo->Call(Foo, 1, args1)); -$a1 = $Foo->Call($context, $Foo, $args1); -// CHECK_EQ(1u, a1->Length()); -$v8_helper->CHECK_EQ(1, $a1->Length(), '1, $a1->Length()'); -// CHECK_EQ(1.1, a1->Get(v8::Integer::New(isolate, 0))->NumberValue()); -$v8_helper->CHECK_EQ(1.1, $a1->Get($context, new \V8\IntegerValue($isolate, 0))->Value(), '1.1, $a1->Get($context, 0)->Value()'); -$helper->line(); - -// v8::Handle args2[] = {v8_num(2.2), v8_num(3.3)}; -$args2 = [new \V8\NumberValue($isolate, 2.2), new \V8\NumberValue($isolate, 3.3)]; -// Local a2 = Local::Cast(Foo->Call(Foo, 2, args2)); -$a2 = $Foo->Call($context, $Foo, $args2); -// CHECK_EQ(2u, a2->Length()); -$v8_helper->CHECK_EQ(2, $a2->Length(), '2, $a2->Length()'); -// CHECK_EQ(2.2, a2->Get(v8::Integer::New(isolate, 0))->NumberValue()); -$v8_helper->CHECK_EQ(2.2, $a2->Get($context, new \V8\IntegerValue($isolate, 0))->Value(), '2.2, $a2->Get($context, 0)->Value()'); -// CHECK_EQ(3.3, a2->Get(v8::Integer::New(isolate, 1))->NumberValue()); -$v8_helper->CHECK_EQ(3.3, $a2->Get($context, new \V8\IntegerValue($isolate, 1))->Value(), '3.3, $a2->Get($context, 1)->Value()'); -$helper->line(); - - -// v8::Handle args3[] = {v8_num(4.4), v8_num(5.5), v8_num(6.6)}; -$args3 = [new \V8\NumberValue($isolate, 4.4), new \V8\NumberValue($isolate, 5.5), new \V8\NumberValue($isolate, 6.6)]; -// Local a3 = Local::Cast(Foo->Call(Foo, 3, args3)); -$a3 = $Foo->Call($context, $Foo, $args3); -// CHECK_EQ(3u, a3->Length()); -$v8_helper->CHECK_EQ(3, $a3->Length(), '3, $a3->Length()'); -// CHECK_EQ(4.4, a3->Get(v8::Integer::New(isolate, 0))->NumberValue()); -$v8_helper->CHECK_EQ(4.4, $a3->Get($context, new \V8\IntegerValue($isolate, 0))->Value(), '4.4, $a3->Get($context, 0)->Value()'); -// CHECK_EQ(5.5, a3->Get(v8::Integer::New(isolate, 1))->NumberValue()); -$v8_helper->CHECK_EQ(5.5, $a3->Get($context, new \V8\IntegerValue($isolate, 1))->Value(), '5.5, $a3->Get($context, 1)->Value()'); -// CHECK_EQ(6.6, a3->Get(v8::Integer::New(isolate, 2))->NumberValue()); -$v8_helper->CHECK_EQ(6.6, $a3->Get($context, new \V8\IntegerValue($isolate, 2))->Value(), '6.6, $a3->Get($context, 2)->Value()'); -$helper->line(); - -// v8::Handle args4[] = {v8_num(7.7), v8_num(8.8), v8_num(9.9), v8_num(10.11)}; -$args4 = [new \V8\NumberValue($isolate, 7.7), new \V8\NumberValue($isolate, 8.8), new \V8\NumberValue($isolate, 9.9), new \V8\NumberValue($isolate, 10.11)]; -// Local a4 = Local::Cast(Foo->Call(Foo, 4, args4)); -$a4 = $Foo->Call($context, $Foo, $args4); -// CHECK_EQ(4u, a4->Length()); -$v8_helper->CHECK_EQ(4, $a4->Length(), '4, $a4->Length()'); -// CHECK_EQ(7.7, a4->Get(v8::Integer::New(isolate, 0))->NumberValue()); -$v8_helper->CHECK_EQ(7.7, $a4->Get($context, new \V8\IntegerValue($isolate, 0))->Value(), '7.7, $a4->Get($context, 0)->Value()'); -// CHECK_EQ(8.8, a4->Get(v8::Integer::New(isolate, 1))->NumberValue()); -$v8_helper->CHECK_EQ(8.8, $a4->Get($context, new \V8\IntegerValue($isolate, 1))->Value(), '8.8, $a4->Get($context, 1)->Value()'); -// CHECK_EQ(9.9, a4->Get(v8::Integer::New(isolate, 2))->NumberValue()); -$v8_helper->CHECK_EQ(9.9, $a4->Get($context, new \V8\IntegerValue($isolate, 2))->Value(), '9.9, $a4->Get($context, 2)->Value()'); -// CHECK_EQ(10.11, a4->Get(v8::Integer::New(isolate, 3))->NumberValue()); -$v8_helper->CHECK_EQ(10.11, $a4->Get($context, new \V8\IntegerValue($isolate, 3))->Value(), '10.11, $a4->Get($context, 3)->Value()'); -$helper->line(); - -// Local r1 = ReturnThisSloppy->Call(v8::Undefined(isolate), 0, NULL); -$r1 = $ReturnThisSloppy->Call($context, new \V8\UndefinedValue($isolate), []); -// CHECK(r1->StrictEquals(context->Global())); -$v8_helper->CHECK($r1->StrictEquals($context->GlobalObject()), '$r1->StrictEquals($context->GlobalObject())'); -// Local r2 = ReturnThisSloppy->Call(v8::Null(isolate), 0, NULL); -$r2 = $ReturnThisSloppy->Call($context, new \V8\NullValue($isolate), []); -// CHECK(r2->StrictEquals(context->Global())); -$v8_helper->CHECK($r2->StrictEquals($context->GlobalObject()), '$r2->StrictEquals($context->GlobalObject())'); -// Local r3 = ReturnThisSloppy->Call(v8_num(42), 0, NULL); -/** @var \V8\NumberObject $r3 */ -$r3 = $ReturnThisSloppy->Call($context, new \V8\NumberValue($isolate, 42), []); -$helper->value_instanceof($r3, '\V8\NumberObject'); -// CHECK(r3->IsNumberObject()); -$v8_helper->CHECK($r3->IsNumberObject(), '$r3->IsNumberObject()'); -// CHECK_EQ(42.0, r3.As()->ValueOf()); -$v8_helper->CHECK_EQ(42.0, $r3->ValueOf(), '42.0, $r3->ValueOf()'); -// Local r4 = ReturnThisSloppy->Call(v8_str("hello"), 0, NULL); -$helper->line(); - -/** @var \V8\StringObject $r4 */ -$r4 = $ReturnThisSloppy->Call($context, new \V8\StringValue($isolate, 'hello'), []); -$helper->value_instanceof($r4, '\V8\StringObject'); -// CHECK(r4->IsStringObject()); -$v8_helper->CHECK($r4->IsStringObject(), '$r4->IsStringObject()'); -// CHECK(r4.As()->ValueOf()->StrictEquals(v8_str("hello"))); -$v8_helper->CHECK($r4->ValueOf()->StrictEquals(new \V8\StringValue($isolate, 'hello')), '$r4->ValueOf()->StrictEquals(new \V8\StringValue($isolate, \'hello\'))'); -$helper->line(); - -// Local r5 = ReturnThisSloppy->Call(v8::True(isolate), 0, NULL); -/** @var \V8\BooleanObject $r5 */ -$r5 = $ReturnThisSloppy->Call($context, new \V8\BooleanValue($isolate, true), []); -$helper->value_instanceof($r5, '\V8\BooleanObject'); -// CHECK(r5->IsBooleanObject()); -$v8_helper->CHECK($r5->IsBooleanObject(), '$r5->IsBooleanObject()'); -// CHECK(r5.As()->ValueOf()); -$v8_helper->CHECK($r5->ValueOf(), '$r5->ValueOf()'); -$helper->line(); - -// Local r6 = ReturnThisStrict->Call(v8::Undefined(isolate), 0, NULL); -$r6 = $ReturnThisStrict->Call($context, new \V8\UndefinedValue($isolate), []); -// CHECK(r6->IsUndefined()); -$v8_helper->CHECK($r6->IsUndefined(), '$r6->IsUndefined()'); -// Local r7 = ReturnThisStrict->Call(v8::Null(isolate), 0, NULL); -$r7 = $ReturnThisStrict->Call($context, new \V8\NullValue($isolate), []); -// CHECK(r7->IsNull()); -$v8_helper->CHECK($r7->IsNull(), '$r7->IsNull()'); -// Local r8 = ReturnThisStrict->Call(v8_num(42), 0, NULL); -$r8 = $ReturnThisStrict->Call($context, new \V8\NumberValue($isolate, 42), []); -// CHECK(r8->StrictEquals(v8_num(42))); -$v8_helper->CHECK($r8->StrictEquals(new \V8\NumberValue($isolate, 42)), '$r8->StrictEquals(new \V8\NumberValue($isolate, 42))'); -// Local r9 = ReturnThisStrict->Call(v8_str("hello"), 0, NULL); -$r9 = $ReturnThisStrict->Call($context, new \V8\StringValue($isolate, 'hello'), []); -// CHECK(r9->StrictEquals(v8_str("hello"))); -$v8_helper->CHECK($r9->StrictEquals(new \V8\StringValue($isolate, 'hello')), '$r9->StrictEquals(new \V8\StringValue($isolate, \'hello\')'); -// Local r10 = ReturnThisStrict->Call(v8::True(isolate), 0, NULL); -$r10 = $ReturnThisStrict->Call($context, new \V8\BooleanValue($isolate, true), []); -// CHECK(r10->StrictEquals(v8::True(isolate))); -$v8_helper->CHECK($r10->StrictEquals(new \V8\BooleanValue($isolate, true)), '$r10->StrictEquals(new \V8\BooleanValue($isolate, true))'); -//} - -echo PHP_EOL; -echo 'We are done for now', PHP_EOL; - -?> ---EXPECT-- -CHECK_EQ (0, $a0->Length()): OK - -CHECK_EQ (1, $a1->Length()): OK -CHECK_EQ (1.1, $a1->Get($context, 0)->Value()): OK - -CHECK_EQ (2, $a2->Length()): OK -CHECK_EQ (2.2, $a2->Get($context, 0)->Value()): OK -CHECK_EQ (3.3, $a2->Get($context, 1)->Value()): OK - -CHECK_EQ (3, $a3->Length()): OK -CHECK_EQ (4.4, $a3->Get($context, 0)->Value()): OK -CHECK_EQ (5.5, $a3->Get($context, 1)->Value()): OK -CHECK_EQ (6.6, $a3->Get($context, 2)->Value()): OK - -CHECK_EQ (4, $a4->Length()): OK -CHECK_EQ (7.7, $a4->Get($context, 0)->Value()): OK -CHECK_EQ (8.8, $a4->Get($context, 1)->Value()): OK -CHECK_EQ (9.9, $a4->Get($context, 2)->Value()): OK -CHECK_EQ (10.11, $a4->Get($context, 3)->Value()): OK - -CHECK $r1->StrictEquals($context->GlobalObject()): OK -CHECK $r2->StrictEquals($context->GlobalObject()): OK -Value is instance of \V8\NumberObject -CHECK $r3->IsNumberObject(): OK -CHECK_EQ (42.0, $r3->ValueOf()): OK - -Value is instance of \V8\StringObject -CHECK $r4->IsStringObject(): OK -CHECK $r4->ValueOf()->StrictEquals(new \V8\StringValue($isolate, 'hello')): OK - -Value is instance of \V8\BooleanObject -CHECK $r5->IsBooleanObject(): OK -CHECK $r5->ValueOf(): OK - -CHECK $r6->IsUndefined(): OK -CHECK $r7->IsNull(): OK -CHECK $r8->StrictEquals(new \V8\NumberValue($isolate, 42)): OK -CHECK $r9->StrictEquals(new \V8\StringValue($isolate, 'hello'): OK -CHECK $r10->StrictEquals(new \V8\BooleanValue($isolate, true)): OK - -We are done for now diff --git a/tests/V8FunctionObject_call.phpt b/tests/V8FunctionObject_call.phpt new file mode 100644 index 0000000..bf0ef11 --- /dev/null +++ b/tests/V8FunctionObject_call.phpt @@ -0,0 +1,234 @@ +--TEST-- +V8\FunctionObject::call() +--SKIPIF-- + +--FILE-- +getIsolate(); +// v8::HandleScope scope(isolate); + +$isolate = new \V8\Isolate(); +$context = new \V8\Context($isolate); + +// CompileRun( +// "function Foo() {" +// " var result = [];" +// " for (var i = 0; i < arguments.length; i++) {" +// " result.push(arguments[i]);" +// " }" +// " return result;" +// "}" +// "function ReturnThisSloppy() {" +// " return this;" +// "}" +// "function ReturnThisStrict() {" +// " 'use strict';" +// " return this;" +// "}"); + +$v8_helper->CompileRun( + $context, "" + . "function Foo() {" + . " var result = [];" + . " for (var i = 0; i < arguments.length; i++) {" + . " result.push(arguments[i]);" + . " }" + . " return result;" + . "}" + . "function ReturnThisSloppy() {" + . " return this;" + . "}" + . "function ReturnThisStrict() {" + . " 'use strict';" + . " return this;" + . "}" +); + +// Local Foo = Local::Cast(context->Global()->get(v8_str("Foo"))); +$Foo = $context->globalObject()->get($context, new \V8\StringValue($isolate, 'Foo')); + +// Local ReturnThisSloppy = Local::Cast(context->Global()->get(v8_str("ReturnThisSloppy"))); +$ReturnThisSloppy = $context->globalObject()->get($context, new \V8\StringValue($isolate, 'ReturnThisSloppy')); + +// Local ReturnThisStrict = Local::Cast(context->Global()->get(v8_str("ReturnThisStrict"))); +$ReturnThisStrict = $context->globalObject()->get($context, new \V8\StringValue($isolate, 'ReturnThisStrict')); + +// v8::Handle* args0 = NULL; +$args0 = []; +// Local a0 = Local::Cast(Foo->Call(Foo, 0, args0)); +$a0 = $Foo->call($context, $Foo, $args0); +// CHECK_EQ(0u, a0->length()); +$v8_helper->CHECK_EQ(0, $a0->length(), '0, $a0->length()'); +$helper->line(); + +// v8::Handle args1[] = {v8_num(1.1)}; +$args1 = [new \V8\NumberValue($isolate, 1.1)]; +// Local a1 = Local::Cast(Foo->Call(Foo, 1, args1)); +$a1 = $Foo->call($context, $Foo, $args1); +// CHECK_EQ(1u, a1->length()); +$v8_helper->CHECK_EQ(1, $a1->length(), '1, $a1->length()'); +// CHECK_EQ(1.1, a1->get(v8::Integer::New(isolate, 0))->numberValue()); +$v8_helper->CHECK_EQ(1.1, $a1->get($context, new \V8\IntegerValue($isolate, 0))->value(), '1.1, $a1->get($context, 0)->value()'); +$helper->line(); + +// v8::Handle args2[] = {v8_num(2.2), v8_num(3.3)}; +$args2 = [new \V8\NumberValue($isolate, 2.2), new \V8\NumberValue($isolate, 3.3)]; +// Local a2 = Local::Cast(Foo->Call(Foo, 2, args2)); +$a2 = $Foo->call($context, $Foo, $args2); +// CHECK_EQ(2u, a2->length()); +$v8_helper->CHECK_EQ(2, $a2->length(), '2, $a2->length()'); +// CHECK_EQ(2.2, a2->get(v8::Integer::New(isolate, 0))->numberValue()); +$v8_helper->CHECK_EQ(2.2, $a2->get($context, new \V8\IntegerValue($isolate, 0))->value(), '2.2, $a2->get($context, 0)->value()'); +// CHECK_EQ(3.3, a2->get(v8::Integer::New(isolate, 1))->numberValue()); +$v8_helper->CHECK_EQ(3.3, $a2->get($context, new \V8\IntegerValue($isolate, 1))->value(), '3.3, $a2->get($context, 1)->value()'); +$helper->line(); + + +// v8::Handle args3[] = {v8_num(4.4), v8_num(5.5), v8_num(6.6)}; +$args3 = [new \V8\NumberValue($isolate, 4.4), new \V8\NumberValue($isolate, 5.5), new \V8\NumberValue($isolate, 6.6)]; +// Local a3 = Local::Cast(Foo->Call(Foo, 3, args3)); +$a3 = $Foo->call($context, $Foo, $args3); +// CHECK_EQ(3u, a3->length()); +$v8_helper->CHECK_EQ(3, $a3->length(), '3, $a3->length()'); +// CHECK_EQ(4.4, a3->get(v8::Integer::New(isolate, 0))->numberValue()); +$v8_helper->CHECK_EQ(4.4, $a3->get($context, new \V8\IntegerValue($isolate, 0))->value(), '4.4, $a3->get($context, 0)->value()'); +// CHECK_EQ(5.5, a3->get(v8::Integer::New(isolate, 1))->numberValue()); +$v8_helper->CHECK_EQ(5.5, $a3->get($context, new \V8\IntegerValue($isolate, 1))->value(), '5.5, $a3->get($context, 1)->value()'); +// CHECK_EQ(6.6, a3->get(v8::Integer::New(isolate, 2))->numberValue()); +$v8_helper->CHECK_EQ(6.6, $a3->get($context, new \V8\IntegerValue($isolate, 2))->value(), '6.6, $a3->get($context, 2)->value()'); +$helper->line(); + +// v8::Handle args4[] = {v8_num(7.7), v8_num(8.8), v8_num(9.9), v8_num(10.11)}; +$args4 = [new \V8\NumberValue($isolate, 7.7), new \V8\NumberValue($isolate, 8.8), new \V8\NumberValue($isolate, 9.9), new \V8\NumberValue($isolate, 10.11)]; +// Local a4 = Local::Cast(Foo->Call(Foo, 4, args4)); +$a4 = $Foo->call($context, $Foo, $args4); +// CHECK_EQ(4u, a4->length()); +$v8_helper->CHECK_EQ(4, $a4->length(), '4, $a4->length()'); +// CHECK_EQ(7.7, a4->get(v8::Integer::New(isolate, 0))->numberValue()); +$v8_helper->CHECK_EQ(7.7, $a4->get($context, new \V8\IntegerValue($isolate, 0))->value(), '7.7, $a4->get($context, 0)->value()'); +// CHECK_EQ(8.8, a4->get(v8::Integer::New(isolate, 1))->numberValue()); +$v8_helper->CHECK_EQ(8.8, $a4->get($context, new \V8\IntegerValue($isolate, 1))->value(), '8.8, $a4->get($context, 1)->value()'); +// CHECK_EQ(9.9, a4->get(v8::Integer::New(isolate, 2))->numberValue()); +$v8_helper->CHECK_EQ(9.9, $a4->get($context, new \V8\IntegerValue($isolate, 2))->value(), '9.9, $a4->get($context, 2)->value()'); +// CHECK_EQ(10.11, a4->get(v8::Integer::New(isolate, 3))->numberValue()); +$v8_helper->CHECK_EQ(10.11, $a4->get($context, new \V8\IntegerValue($isolate, 3))->value(), '10.11, $a4->get($context, 3)->value()'); +$helper->line(); + +// Local r1 = ReturnThisSloppy->Call(v8::Undefined(isolate), 0, NULL); +$r1 = $ReturnThisSloppy->call($context, new \V8\UndefinedValue($isolate), []); +// CHECK(r1->strictEquals(context->Global())); +$v8_helper->CHECK($r1->strictEquals($context->globalObject()), '$r1->strictEquals($context->globalObject())'); +// Local r2 = ReturnThisSloppy->Call(v8::Null(isolate), 0, NULL); +$r2 = $ReturnThisSloppy->call($context, new \V8\NullValue($isolate), []); +// CHECK(r2->strictEquals(context->Global())); +$v8_helper->CHECK($r2->strictEquals($context->globalObject()), '$r2->strictEquals($context->globalObject())'); +// Local r3 = ReturnThisSloppy->Call(v8_num(42), 0, NULL); +/** @var \V8\NumberObject $r3 */ +$r3 = $ReturnThisSloppy->call($context, new \V8\NumberValue($isolate, 42), []); +$helper->value_instanceof($r3, '\V8\NumberObject'); +// CHECK(r3->isNumberObject()); +$v8_helper->CHECK($r3->isNumberObject(), '$r3->isNumberObject()'); +// CHECK_EQ(42.0, r3.As()->valueOf()); +$v8_helper->CHECK_EQ(42.0, $r3->valueOf(), '42.0, $r3->valueOf()'); +// Local r4 = ReturnThisSloppy->Call(v8_str("hello"), 0, NULL); +$helper->line(); + +/** @var \V8\StringObject $r4 */ +$r4 = $ReturnThisSloppy->call($context, new \V8\StringValue($isolate, 'hello'), []); +$helper->value_instanceof($r4, '\V8\StringObject'); +// CHECK(r4->isStringObject()); +$v8_helper->CHECK($r4->isStringObject(), '$r4->isStringObject()'); +// CHECK(r4.As()->valueOf()->strictEquals(v8_str("hello"))); +$v8_helper->CHECK($r4->valueOf()->strictEquals(new \V8\StringValue($isolate, 'hello')), '$r4->valueOf()->strictEquals(new \V8\StringValue($isolate, \'hello\'))'); +$helper->line(); + +// Local r5 = ReturnThisSloppy->Call(v8::True(isolate), 0, NULL); +/** @var \V8\BooleanObject $r5 */ +$r5 = $ReturnThisSloppy->call($context, new \V8\BooleanValue($isolate, true), []); +$helper->value_instanceof($r5, '\V8\BooleanObject'); +// CHECK(r5->isBooleanObject()); +$v8_helper->CHECK($r5->isBooleanObject(), '$r5->isBooleanObject()'); +// CHECK(r5.As()->valueOf()); +$v8_helper->CHECK($r5->valueOf(), '$r5->valueOf()'); +$helper->line(); + +// Local r6 = ReturnThisStrict->Call(v8::Undefined(isolate), 0, NULL); +$r6 = $ReturnThisStrict->call($context, new \V8\UndefinedValue($isolate), []); +// CHECK(r6->isUndefined()); +$v8_helper->CHECK($r6->isUndefined(), '$r6->isUndefined()'); +// Local r7 = ReturnThisStrict->Call(v8::Null(isolate), 0, NULL); +$r7 = $ReturnThisStrict->call($context, new \V8\NullValue($isolate), []); +// CHECK(r7->isNull()); +$v8_helper->CHECK($r7->isNull(), '$r7->isNull()'); +// Local r8 = ReturnThisStrict->Call(v8_num(42), 0, NULL); +$r8 = $ReturnThisStrict->call($context, new \V8\NumberValue($isolate, 42), []); +// CHECK(r8->strictEquals(v8_num(42))); +$v8_helper->CHECK($r8->strictEquals(new \V8\NumberValue($isolate, 42)), '$r8->strictEquals(new \V8\NumberValue($isolate, 42))'); +// Local r9 = ReturnThisStrict->Call(v8_str("hello"), 0, NULL); +$r9 = $ReturnThisStrict->call($context, new \V8\StringValue($isolate, 'hello'), []); +// CHECK(r9->strictEquals(v8_str("hello"))); +$v8_helper->CHECK($r9->strictEquals(new \V8\StringValue($isolate, 'hello')), '$r9->strictEquals(new \V8\StringValue($isolate, \'hello\')'); +// Local r10 = ReturnThisStrict->Call(v8::True(isolate), 0, NULL); +$r10 = $ReturnThisStrict->call($context, new \V8\BooleanValue($isolate, true), []); +// CHECK(r10->strictEquals(v8::True(isolate))); +$v8_helper->CHECK($r10->strictEquals(new \V8\BooleanValue($isolate, true)), '$r10->strictEquals(new \V8\BooleanValue($isolate, true))'); +//} + +echo PHP_EOL; +echo 'We are done for now', PHP_EOL; + +?> +--EXPECT-- +CHECK_EQ (0, $a0->length()): OK + +CHECK_EQ (1, $a1->length()): OK +CHECK_EQ (1.1, $a1->get($context, 0)->value()): OK + +CHECK_EQ (2, $a2->length()): OK +CHECK_EQ (2.2, $a2->get($context, 0)->value()): OK +CHECK_EQ (3.3, $a2->get($context, 1)->value()): OK + +CHECK_EQ (3, $a3->length()): OK +CHECK_EQ (4.4, $a3->get($context, 0)->value()): OK +CHECK_EQ (5.5, $a3->get($context, 1)->value()): OK +CHECK_EQ (6.6, $a3->get($context, 2)->value()): OK + +CHECK_EQ (4, $a4->length()): OK +CHECK_EQ (7.7, $a4->get($context, 0)->value()): OK +CHECK_EQ (8.8, $a4->get($context, 1)->value()): OK +CHECK_EQ (9.9, $a4->get($context, 2)->value()): OK +CHECK_EQ (10.11, $a4->get($context, 3)->value()): OK + +CHECK $r1->strictEquals($context->globalObject()): OK +CHECK $r2->strictEquals($context->globalObject()): OK +Value is instance of \V8\NumberObject +CHECK $r3->isNumberObject(): OK +CHECK_EQ (42.0, $r3->valueOf()): OK + +Value is instance of \V8\StringObject +CHECK $r4->isStringObject(): OK +CHECK $r4->valueOf()->strictEquals(new \V8\StringValue($isolate, 'hello')): OK + +Value is instance of \V8\BooleanObject +CHECK $r5->isBooleanObject(): OK +CHECK $r5->valueOf(): OK + +CHECK $r6->isUndefined(): OK +CHECK $r7->isNull(): OK +CHECK $r8->strictEquals(new \V8\NumberValue($isolate, 42)): OK +CHECK $r9->strictEquals(new \V8\StringValue($isolate, 'hello'): OK +CHECK $r10->strictEquals(new \V8\BooleanValue($isolate, true)): OK + +We are done for now diff --git a/tests/V8FunctionObject_Call_bad_args.phpt b/tests/V8FunctionObject_call_bad_args.phpt similarity index 72% rename from tests/V8FunctionObject_Call_bad_args.phpt rename to tests/V8FunctionObject_call_bad_args.phpt index 1c3c8fb..a174085 100644 --- a/tests/V8FunctionObject_Call_bad_args.phpt +++ b/tests/V8FunctionObject_call_bad_args.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\FunctionObject::Call() - calling with bad args +V8\FunctionObject::call() - calling with bad args --SKIPIF-- Call($context, $fnc, [1]); + $fnc->call($context, $fnc, [1]); } catch(Throwable $e) { $helper->exception_export($e); } try { - $fnc->Call($context, $fnc, [new stdClass()]); + $fnc->call($context, $fnc, [new stdClass()]); } catch(Throwable $e) { $helper->exception_export($e); } @@ -42,7 +42,7 @@ try { } }; - $fnc->Call($context, $fnc, [$arg]); + $fnc->call($context, $fnc, [$arg]); } catch(Throwable $e) { $helper->exception_export($e); } @@ -50,13 +50,13 @@ try { try { $isolate2 = new \V8\Isolate(); - $fnc->Call($context, $fnc, [new \V8\StringValue($isolate2)]); + $fnc->call($context, $fnc, [new \V8\StringValue($isolate2)]); } catch(Throwable $e) { $helper->exception_export($e); } ?> --EXPECT-- -TypeError: Argument 3 passed to V8\FunctionObject::Call() must be an array of \V8\Value objects, integer given at 0 offset -TypeError: Argument 3 passed to V8\FunctionObject::Call() must be an array of \V8\Value objects, instance of stdClass given at 0 offset -V8\Exceptions\Exception: Value is empty. Forgot to call parent::__construct()?: argument 3 passed to V8\FunctionObject::Call() at 0 offset -V8\Exceptions\Exception: Isolates mismatch: argument 3 passed to V8\FunctionObject::Call() at 0 offset +TypeError: Argument 3 passed to V8\FunctionObject::call() must be an array of \V8\Value objects, integer given at 0 offset +TypeError: Argument 3 passed to V8\FunctionObject::call() must be an array of \V8\Value objects, instance of stdClass given at 0 offset +V8\Exceptions\Exception: Value is empty. Forgot to call parent::__construct()?: argument 3 passed to V8\FunctionObject::call() at 0 offset +V8\Exceptions\Exception: Isolates mismatch: argument 3 passed to V8\FunctionObject::call() at 0 offset diff --git a/tests/V8FunctionObject_constructor_behavior.phpt b/tests/V8FunctionObject_constructor_behavior.phpt index 6aa6d1f..52eb8c9 100644 --- a/tests/V8FunctionObject_constructor_behavior.phpt +++ b/tests/V8FunctionObject_constructor_behavior.phpt @@ -27,8 +27,8 @@ $f_throw = new \V8\FunctionObject($context, function () { echo 'Throw', PHP_EOL; }, 0, \V8\ConstructorBehavior::kThrow); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'f_allow'), $f_allow); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'f_throw'), $f_throw); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'f_allow'), $f_allow); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'f_throw'), $f_throw); $v8_helper->CompileRun($context, 'f_allow(); new f_allow();'); diff --git a/tests/V8FunctionObject_die.phpt b/tests/V8FunctionObject_die.phpt index e8dcbea..1b07338 100644 --- a/tests/V8FunctionObject_die.phpt +++ b/tests/V8FunctionObject_die.phpt @@ -23,7 +23,7 @@ $func = new v8Tests\TrackingDtors\FunctionObject($context, function (\V8\Functio }); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test'), $func); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test'), $func); $source = 'test(); "Script done"'; $file_name = 'test.js'; @@ -31,7 +31,7 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context)->ToString($context)->Value(); +$res = $script->run($context)->toString($context)->value(); $helper->pretty_dump('Script result', $res); echo 'We are done for now', PHP_EOL; diff --git a/tests/V8FunctionObject_die_different_isolates.phpt b/tests/V8FunctionObject_die_different_isolates.phpt index 92b65a3..38b068a 100644 --- a/tests/V8FunctionObject_die_different_isolates.phpt +++ b/tests/V8FunctionObject_die_different_isolates.phpt @@ -23,7 +23,7 @@ $die_func = new v8Tests\TrackingDtors\FunctionObject($context_inner, function (\ die(); }); -$context_inner->GlobalObject()->Set($context_inner, new \V8\StringValue($isolate_inner, 'die'), $die_func); +$context_inner->globalObject()->set($context_inner, new \V8\StringValue($isolate_inner, 'die'), $die_func); $die_func->destructor_test_message = 'die() function from inner isolate dtored'; $isolate_inner->destructor_test_message = 'inner isolate dtored'; @@ -35,22 +35,22 @@ $context_outer = new V8\Context($isolate_outer); $test_other_func = new v8Tests\TrackingDtors\FunctionObject($context_outer, function (\V8\FunctionCallbackInfo $info) use ($context_inner) { echo 'calling inner...', PHP_EOL; - $isolate_inner = $context_inner->GetIsolate(); - $global_inner = $context_inner->GlobalObject(); + $isolate_inner = $context_inner->getIsolate(); + $global_inner = $context_inner->globalObject(); - $global_inner->Get($context_inner, new \V8\StringValue($isolate_inner, 'die'))->Call($context_inner, $global_inner); + $global_inner->get($context_inner, new \V8\StringValue($isolate_inner, 'die'))->call($context_inner, $global_inner); }); $test_other_func->destructor_test_message = 'test_other() function from outer isolate dtored'; $isolate_outer->destructor_test_message = 'outer isolate dtored'; -$context_outer->GlobalObject()->Set($context_outer, new \V8\StringValue($isolate_outer, 'test_other'), $test_other_func); +$context_outer->globalObject()->set($context_outer, new \V8\StringValue($isolate_outer, 'test_other'), $test_other_func); $res = $v8_helper->CompileRun($context_outer, 'test_other(); "Script done"'); -$helper->pretty_dump('Script result', $res->ToString($context_outer)->Value()); +$helper->pretty_dump('Script result', $res->toString($context_outer)->value()); echo 'We are done for now', PHP_EOL; diff --git a/tests/V8FunctionObject_die_nested.phpt b/tests/V8FunctionObject_die_nested.phpt index 2b7e285..f8376cc 100644 --- a/tests/V8FunctionObject_die_nested.phpt +++ b/tests/V8FunctionObject_die_nested.phpt @@ -27,21 +27,21 @@ $die_func->destructor_test_message = 'die() function dtored'; $teste_nested_func = new v8Tests\TrackingDtors\FunctionObject($context, function (\V8\FunctionCallbackInfo $info) { echo 'calling nested...', PHP_EOL; - $context = $info->GetContext(); + $context = $info->getContext(); - $context->GlobalObject()->Get($context, new \V8\StringValue($context->GetIsolate(), 'die'))->Call($context, $context->GlobalObject()); + $context->globalObject()->get($context, new \V8\StringValue($context->getIsolate(), 'die'))->call($context, $context->globalObject()); }); $teste_nested_func->destructor_test_message = 'test_nested() function dtored'; -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'die'), $die_func); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test_nested'), $teste_nested_func); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'die'), $die_func); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test_nested'), $teste_nested_func); $res = $v8_helper->CompileRun($context, 'test_nested(); "Script done"'); -$helper->pretty_dump('Script result', $res->ToString($context)->Value()); +$helper->pretty_dump('Script result', $res->toString($context)->value()); echo 'We are done for now', PHP_EOL; diff --git a/tests/V8FunctionObject_NewInstance.phpt b/tests/V8FunctionObject_newInstance.phpt similarity index 63% rename from tests/V8FunctionObject_NewInstance.phpt rename to tests/V8FunctionObject_newInstance.phpt index baec4ae..12f5a34 100644 --- a/tests/V8FunctionObject_NewInstance.phpt +++ b/tests/V8FunctionObject_newInstance.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\FunctionObject::NewInstance() +V8\FunctionObject::newInstance() --SKIPIF-- GlobalObject(); +$global= $context->globalObject(); $tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $args) { - echo 'called as ', $args->IsConstructCall() ? 'constructor' : 'function', ' '; - echo 'with ', count($args->Arguments()), ' arguments'; + echo 'called as ', $args->isConstructCall() ? 'constructor' : 'function', ' '; + echo 'with ', count($args->arguments()), ' arguments'; echo PHP_EOL; }); -$tpl->GetFunction($context)->NewInstance($context); -$tpl->GetFunction($context)->NewInstance($context, [new \V8\StringValue($isolate, 'argument1')]); -$tpl->GetFunction($context)->NewInstance($context, [new \V8\ObjectValue($context)]); +$tpl->getFunction($context)->newInstance($context); +$tpl->getFunction($context)->newInstance($context, [new \V8\StringValue($isolate, 'argument1')]); +$tpl->getFunction($context)->newInstance($context, [new \V8\ObjectValue($context)]); ?> diff --git a/tests/V8FunctionObject_weakness_multiple.phpt b/tests/V8FunctionObject_weakness_multiple.phpt index 3aeb80b..69979ba 100644 --- a/tests/V8FunctionObject_weakness_multiple.phpt +++ b/tests/V8FunctionObject_weakness_multiple.phpt @@ -24,34 +24,34 @@ $func = new v8Tests\TrackingDtors\FunctionObject($context, function (\V8\Functio echo 'Should output Hello World string', PHP_EOL; }); -$func->SetAccessor($context, new \V8\StringValue($isolate, 'nonexistent'), function () { echo 'get nonexistent 1', PHP_EOL; } ); +$func->setAccessor($context, new \V8\StringValue($isolate, 'nonexistent'), function () { echo 'get nonexistent 1', PHP_EOL; } ); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'print'), $func); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'print'), $func); $func = null; $v8_helper->CompileRun($context, 'print("test"); print.nonexistent; '); -$fnc1 = $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'print')); +$fnc1 = $context->globalObject()->get($context, new \V8\StringValue($isolate, 'print')); /** @var $fnc1 \V8\FunctionObject */ -$fnc1->SetAccessor($context, new \V8\StringValue($isolate, 'nonexistent'), function () { echo 'get nonexistent 2', PHP_EOL; } ); +$fnc1->setAccessor($context, new \V8\StringValue($isolate, 'nonexistent'), function () { echo 'get nonexistent 2', PHP_EOL; } ); $v8_helper->CompileRun($context, 'print("test"); print.nonexistent; '); $fnc1 = null; -$fnc2 = $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'print')); +$fnc2 = $context->globalObject()->get($context, new \V8\StringValue($isolate, 'print')); /** @var $fnc1 \V8\FunctionObject */ -$fnc2->SetAccessor($context, new \V8\StringValue($isolate, 'nonexistent'), function () { echo 'get nonexistent 3', PHP_EOL; } ); +$fnc2->setAccessor($context, new \V8\StringValue($isolate, 'nonexistent'), function () { echo 'get nonexistent 3', PHP_EOL; } ); $v8_helper->CompileRun($context, 'print("test"); print.nonexistent; '); $fnc2 = null; echo 'Persistent should be removed', PHP_EOL; -$isolate->LowMemoryNotification(); +$isolate->lowMemoryNotification(); // Here newly create object internally linked to specific callback and persistent, but as it has no own callback, free'ing // it shouldn't affect functionality -$fnc3 = $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'print')); +$fnc3 = $context->globalObject()->get($context, new \V8\StringValue($isolate, 'print')); $v8_helper->CompileRun($context, 'print("test"); print.nonexistent;'); $fnc3 = null; $v8_helper->CompileRun($context, 'print("test"); print.nonexistent;'); @@ -59,7 +59,7 @@ $v8_helper->CompileRun($context, 'print("test"); print.nonexistent;'); $context = null; echo 'Context should be removed', PHP_EOL; -$isolate->LowMemoryNotification(); +$isolate->lowMemoryNotification(); echo 'We are done for now', PHP_EOL; diff --git a/tests/V8FunctionTemplate.phpt b/tests/V8FunctionTemplate.phpt index 383cab2..d15fa7f 100644 --- a/tests/V8FunctionTemplate.phpt +++ b/tests/V8FunctionTemplate.phpt @@ -34,19 +34,19 @@ $helper->assert('FunctionTemplate implements AdjustableExternalMemoryInterface', $helper->line(); $print_func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) { - $context = $info->GetContext(); + $context = $info->getContext(); $out = []; - foreach ($info->Arguments() as $arg) { - if ($arg->IsUndefined()) { + foreach ($info->arguments() as $arg) { + if ($arg->isUndefined()) { $out[] = ''; - } elseif ($arg->IsNull()) { + } elseif ($arg->isNull()) { $out[] = var_export(null, true); - } elseif ($arg->IsTrue() || $arg->IsFalse()) { - $out[] = var_export($arg->BooleanValue($context), true); + } elseif ($arg->isTrue() || $arg->isFalse()) { + $out[] = var_export($arg->booleanValue($context), true); } else { - $out[] = $arg->ToString($context)->Value(); + $out[] = $arg->toString($context)->value(); } } @@ -55,7 +55,7 @@ $print_func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallb -$function_template->SetClassName(new \V8\StringValue($isolate, 'TestFunction')); +$function_template->setClassName(new \V8\StringValue($isolate, 'TestFunction')); $helper->header('Object representation'); @@ -63,23 +63,23 @@ $helper->dump($function_template); $helper->space(); $helper->header('Accessors'); -$helper->method_matches($function_template, 'GetIsolate', $isolate); +$helper->method_matches($function_template, 'getIsolate', $isolate); $helper->space(); $helper->header('Instance template'); -$instance_template = $function_template->InstanceTemplate(); +$instance_template = $function_template->instanceTemplate(); $helper->dump($instance_template); -$helper->method_matches($function_template, 'InstanceTemplate', $instance_template); +$helper->method_matches($function_template, 'instanceTemplate', $instance_template); $helper->space(); $global_template = new V8\ObjectTemplate($isolate); $value = new V8\StringValue($isolate, 'TEST VALUE 111'); -$global_template->Set(new \V8\StringValue($isolate, 'test'), $value); -$global_template->Set(new \V8\StringValue($isolate, 'func'), $function_template); -$global_template->Set(new \V8\StringValue($isolate, 'print'), $print_func_tpl, \V8\PropertyAttribute::DontDelete); +$global_template->set(new \V8\StringValue($isolate, 'test'), $value); +$global_template->set(new \V8\StringValue($isolate, 'func'), $function_template); +$global_template->set(new \V8\StringValue($isolate, 'print'), $print_func_tpl, \V8\PropertyAttribute::DontDelete); $context = new V8\Context($isolate, $global_template); @@ -96,7 +96,7 @@ $file_name = 'test.js'; $isolate2 = new \V8\Isolate(); $context2 = new V8\Context($isolate2); -$global = $context->GlobalObject(); +$global = $context->globalObject(); $s = new \V8\StringValue($isolate, 'test'); $s2 = new \V8\StringValue($isolate2, 'test 2'); @@ -104,17 +104,17 @@ $s2 = new \V8\StringValue($isolate2, 'test 2'); $o = new \V8\ObjectValue($context); $o2 = new \V8\ObjectValue($context2); -$global->Set($context, new \V8\StringValue($isolate, 's'), $s); +$global->set($context, new \V8\StringValue($isolate, 's'), $s); try { - $global->Set($context, new \V8\StringValue($isolate, 's2'), $s2); + $global->set($context, new \V8\StringValue($isolate, 's2'), $s2); } catch (Exception $e) { $helper->exception_export($e); } -$global->Set($context, new \V8\StringValue($isolate, 'o'), $o); +$global->set($context, new \V8\StringValue($isolate, 'o'), $o); try { - $global->Set($context, new \V8\StringValue($isolate, 'o2'), $o2); + $global->set($context, new \V8\StringValue($isolate, 'o2'), $o2); } catch (Exception $e) { $helper->exception_export($e); } @@ -124,14 +124,14 @@ $helper->value_matches_with_no_output($isolate, $isolate2, true); $res = $v8_helper->CompileRun($context, $source); -$helper->dump($res->IsFunction()); +$helper->dump($res->isFunction()); -if ($res->IsFunction()) { - $func = $res->ToObject($context)->GetConstructorName(); +if ($res->isFunction()) { + $func = $res->toObject($context)->getConstructorName(); $helper->dump($func); } -$helper->dump($res->ToString($context)->Value()); +$helper->dump($res->toString($context)->value()); ?> @@ -159,7 +159,7 @@ object(V8\FunctionTemplate)#5 (1) { Accessors: ---------- -V8\FunctionTemplate::GetIsolate() matches expected value +V8\FunctionTemplate::getIsolate() matches expected value Instance template: @@ -169,7 +169,7 @@ object(V8\ObjectTemplate)#8 (1) { object(V8\Isolate)#3 (0) { } } -V8\FunctionTemplate::InstanceTemplate() doesn't match expected value +V8\FunctionTemplate::instanceTemplate() doesn't match expected value V8\Exceptions\Exception: Isolates mismatch diff --git a/tests/V8FunctionTemplate_callback_weakness.phpt b/tests/V8FunctionTemplate_callback_weakness.phpt index b4b8227..89452fb 100644 --- a/tests/V8FunctionTemplate_callback_weakness.phpt +++ b/tests/V8FunctionTemplate_callback_weakness.phpt @@ -29,7 +29,7 @@ $helper->header('Functions after f1 was set as a callback'); debug_zval_dump($f1); debug_zval_dump($f2); -$fnc->SetCallHandler($f2); +$fnc->setCallHandler($f2); $helper->header('Functions after f2 was set as a callback'); debug_zval_dump($f1); @@ -43,7 +43,7 @@ debug_zval_dump($f2); $isolate = null; //for($i = 0; $i<1000; $i++) { -// $isolate->LowMemoryNotification(); +// $isolate->lowMemoryNotification(); //} $helper->header('Functions after isolate was destroyed'); diff --git a/tests/V8FunctionTemplate_constructor_behavior.phpt b/tests/V8FunctionTemplate_constructor_behavior.phpt index 9310815..2284896 100644 --- a/tests/V8FunctionTemplate_constructor_behavior.phpt +++ b/tests/V8FunctionTemplate_constructor_behavior.phpt @@ -27,8 +27,8 @@ $ftpl_throw = new \V8\FunctionTemplate($isolate, function () { echo 'Throw', PHP_EOL; }, null, 0, \V8\ConstructorBehavior::kThrow); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'f_allow'), $ftpl_allow->GetFunction($context)); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'f_throw'), $ftpl_throw->GetFunction($context)); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'f_allow'), $ftpl_allow->getFunction($context)); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'f_throw'), $ftpl_throw->getFunction($context)); $v8_helper->CompileRun($context, 'f_allow(); new f_allow();'); diff --git a/tests/V8FunctionTemplate_constructor_receiver.phpt b/tests/V8FunctionTemplate_constructor_receiver.phpt index 03e8e2f..66dd1aa 100644 --- a/tests/V8FunctionTemplate_constructor_receiver.phpt +++ b/tests/V8FunctionTemplate_constructor_receiver.phpt @@ -22,15 +22,15 @@ $v8_helper->injectConsoleLog($context); $cb = function (\V8\FunctionCallbackInfo $args) { echo 'Callback', PHP_EOL; - $args->GetReturnValue()->Set(new \V8\IntegerValue($args->GetIsolate(), 42)); + $args->getReturnValue()->set(new \V8\IntegerValue($args->getIsolate(), 42)); }; $sig_obj = new \V8\FunctionTemplate($isolate); $x = new \V8\FunctionTemplate($isolate, $cb, $sig_obj); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'sig_obj'), $sig_obj->GetFunction($context)); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'x'), $x->GetFunction($context)); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'sig_obj'), $sig_obj->getFunction($context)); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'x'), $x->getFunction($context)); $v8_helper->CompileRun($context, "var s = new sig_obj();"); @@ -49,10 +49,10 @@ try { } $res = $v8_helper->CompileRun($context, "s.x = x; s.x()"); -$v8_helper->CHECK_EQ(42, $res->Value()); +$v8_helper->CHECK_EQ(42, $res->value()); $res = $v8_helper->CompileRun($context, "x.call(s)"); -$v8_helper->CHECK_EQ(42, $res->Value()); +$v8_helper->CHECK_EQ(42, $res->value()); ?> diff --git a/tests/V8FunctionTemplate_exception_in_php.phpt b/tests/V8FunctionTemplate_exception_in_php.phpt index 567c776..1c03ee1 100644 --- a/tests/V8FunctionTemplate_exception_in_php.phpt +++ b/tests/V8FunctionTemplate_exception_in_php.phpt @@ -18,7 +18,7 @@ $test_func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallba $global_template = new V8\ObjectTemplate($isolate); -$global_template->Set(new \V8\StringValue($isolate, 'test'), $test_func_tpl, \V8\PropertyAttribute::DontDelete); +$global_template->set(new \V8\StringValue($isolate, 'test'), $test_func_tpl, \V8\PropertyAttribute::DontDelete); $context = new V8\Context($isolate, $global_template); @@ -28,7 +28,7 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); try { - $helper->dump($script->Run($context)->ToString($context)->Value()); + $helper->dump($script->run($context)->toString($context)->value()); } catch (Exception $e) { $helper->exception_export($e); } diff --git a/tests/V8FunctionTemplate_GetFunction.phpt b/tests/V8FunctionTemplate_getFunction.phpt similarity index 82% rename from tests/V8FunctionTemplate_GetFunction.phpt rename to tests/V8FunctionTemplate_getFunction.phpt index df6eb45..a73f7d1 100644 --- a/tests/V8FunctionTemplate_GetFunction.phpt +++ b/tests/V8FunctionTemplate_getFunction.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\FunctionTemplate::GetFunction +V8\FunctionTemplate::getFunction --SKIPIF-- GetFunction($context); +$func_1 = $print_func_tpl->getFunction($context); $helper->object_type($func_1); -$func_2 = $print_func_tpl->GetFunction($context); +$func_2 = $print_func_tpl->getFunction($context); if ($func_1 === $func_2) { echo 'Function instance is the same within single context', PHP_EOL; } else { echo 'Function instance is NOT the same within single context', PHP_EOL; } -$func_3 = $print_func_tpl->GetFunction($context2); +$func_3 = $print_func_tpl->getFunction($context2); if ($func_1 === $func_3) { echo 'Function instance is the same between different contexts', PHP_EOL; @@ -41,7 +41,7 @@ if ($func_1 === $func_3) { echo 'Function instance is NOT the same between different contexts', PHP_EOL; } -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'print'), $func_1); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'print'), $func_1); $source = 'print("Hello, world"); "Script done"'; @@ -50,7 +50,7 @@ $file_name = 'test.js'; $script = new \V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$helper->dump($script->Run($context)->ToString($context)->Value()); +$helper->dump($script->run($context)->toString($context)->value()); echo 'We are done for now', PHP_EOL; diff --git a/tests/V8FunctionTemplate_require_implementation.phpt b/tests/V8FunctionTemplate_require_implementation.phpt index 9665502..e6f54cc 100644 --- a/tests/V8FunctionTemplate_require_implementation.phpt +++ b/tests/V8FunctionTemplate_require_implementation.phpt @@ -24,23 +24,23 @@ $code['test.js'] = 'var out = {"foo" : "unchanged"}; out'; $loaded_cache = []; $require_func_tpl_cache = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use (&$loaded_cache, &$code) { - $isolate = $info->GetIsolate(); - $context = $info->GetContext(); + $isolate = $info->getIsolate(); + $context = $info->getContext(); - $module = $info->Arguments()[0]->ToString($context)->Value(); + $module = $info->arguments()[0]->toString($context)->value(); if (!isset($loaded_cache[$module])) { $new_context = new \V8\Context($isolate, new \V8\ObjectTemplate($isolate)); $script = new \V8\Script($new_context, new \V8\StringValue($isolate, $code[$module]), new \V8\ScriptOrigin($module)); - $loaded_cache[$module] = $script->Run($new_context); + $loaded_cache[$module] = $script->run($new_context); } - $info->GetReturnValue()->Set($loaded_cache[$module]); + $info->getReturnValue()->set($loaded_cache[$module]); }); $global_template = new V8\ObjectTemplate($isolate); -$global_template->Set(new \V8\StringValue($isolate, 'require'), $require_func_tpl_cache, \V8\PropertyAttribute::DontDelete); +$global_template->set(new \V8\StringValue($isolate, 'require'), $require_func_tpl_cache, \V8\PropertyAttribute::DontDelete); $context = new V8\Context($isolate, $global_template); $v8_helper->injectConsoleLog($context); @@ -60,7 +60,7 @@ $file_name2 = 'experiment.js'; $helper->header('Test require() (with cache)'); $script2 = new V8\Script($context, new \V8\StringValue($isolate, $JS), new \V8\ScriptOrigin($file_name2)); -$res2 = $script2->Run($context); +$res2 = $script2->run($context); $helper->space(); @@ -72,10 +72,10 @@ $helper->space(); $loaded_no_cache = []; $require_func_tpl_nocache = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use (&$loaded_no_cache, &$code) { - $isolate = $info->GetIsolate(); - $context = $info->GetContext(); + $isolate = $info->getIsolate(); + $context = $info->getContext(); - $module = $info->Arguments()[0]->ToString($context)->Value(); + $module = $info->arguments()[0]->toString($context)->value(); if (!isset($loaded_no_cache[$module])) { $new_context = new \V8\Context($isolate, new \V8\ObjectTemplate($isolate)); @@ -85,12 +85,12 @@ $require_func_tpl_nocache = new \V8\FunctionTemplate($isolate, function (\V8\Fun $loaded_no_cache[$module] = $script; } - $info->GetReturnValue()->Set($loaded_no_cache[$module]->Run($context)); + $info->getReturnValue()->set($loaded_no_cache[$module]->Run($context)); }); $global_template = new V8\ObjectTemplate($isolate); -$global_template->Set(new \V8\StringValue($isolate, 'require'), $require_func_tpl_nocache, \V8\PropertyAttribute::DontDelete); +$global_template->set(new \V8\StringValue($isolate, 'require'), $require_func_tpl_nocache, \V8\PropertyAttribute::DontDelete); $context = new V8\Context($isolate, $global_template); $v8_helper->injectConsoleLog($context); @@ -110,7 +110,7 @@ $file_name2 = 'experiment.js'; $helper->header('Test require() (no cache)'); $script2 = new V8\Script($context, new \V8\StringValue($isolate, $JS), new \V8\ScriptOrigin($file_name2)); -$res2 = $script2->Run($context); +$res2 = $script2->run($context); ?> --EXPECT-- diff --git a/tests/V8FunctionTemplate_Set.phpt b/tests/V8FunctionTemplate_set.phpt similarity index 66% rename from tests/V8FunctionTemplate_Set.phpt rename to tests/V8FunctionTemplate_set.phpt index 27ae2da..bbc3d51 100644 --- a/tests/V8FunctionTemplate_Set.phpt +++ b/tests/V8FunctionTemplate_set.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\FunctionTemplate::Set() +V8\FunctionTemplate::set() --SKIPIF-- injectConsoleLog($context); // Tests: $ft = new \V8\FunctionTemplate($isolate); -$ft->SetClassName(new \V8\StringValue($isolate, 'Test')); +$ft->setClassName(new \V8\StringValue($isolate, 'Test')); -$proto = $ft->PrototypeTemplate(); +$proto = $ft->prototypeTemplate(); $f = new \V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $args) { }); try { - $proto->Set(new \V8\StringValue($isolate, 'foo'), $f); + $proto->set(new \V8\StringValue($isolate, 'foo'), $f); } catch (TypeError $e) { $helper->exception_export($e); } $ftpl2 = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $args) { - var_dump($args->This(), $args->Holder(), $args->NewTarget()); + var_dump($args->this(), $args->holder(), $args->newTarget()); }); -$proto->Set(new \V8\StringValue($isolate, 'foo'), $ftpl2); +$proto->set(new \V8\StringValue($isolate, 'foo'), $ftpl2); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 't'), $ft->GetFunction($context)); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 't'), $ft->getFunction($context)); $v8_helper->CompileRun($context, ' @@ -52,7 +52,7 @@ console.log(nt.foo); ?> --EXPECT-- -TypeError: Argument 3 passed to V8\ObjectTemplate::Set() must be an instance of \V8\PrimitiveValue or \V8\Template, instance of V8\FunctionObject given +TypeError: Argument 3 passed to V8\ObjectTemplate::set() must be an instance of \V8\PrimitiveValue or \V8\Template, instance of V8\FunctionObject given function Test() { [native code] } [object Test] function foo() { [native code] } diff --git a/tests/V8FunctionTemplate_SetCallHandler.phpt b/tests/V8FunctionTemplate_setCallHandler.phpt similarity index 71% rename from tests/V8FunctionTemplate_SetCallHandler.phpt rename to tests/V8FunctionTemplate_setCallHandler.phpt index 9cf8d48..43a9dc0 100644 --- a/tests/V8FunctionTemplate_SetCallHandler.phpt +++ b/tests/V8FunctionTemplate_setCallHandler.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\FunctionTemplate::SetCallHandler +V8\FunctionTemplate::setCallHandler() --SKIPIF-- SetCallHandler(function () {echo 'callback test()', PHP_EOL;}); +$test_func_tpl->setCallHandler(function () {echo 'callback test()', PHP_EOL;}); try { - $test_func_tpl->SetCallHandler(null); + $test_func_tpl->setCallHandler(null); } catch (Throwable $e) { $helper->exception_export($e); $helper->line(); } $change_func_tpl = new \V8\FunctionTemplate($isolate, function () use ($test_func_tpl){ - $test_func_tpl->SetCallHandler(function () {echo 'callback change()', PHP_EOL;}); + $test_func_tpl->setCallHandler(function () {echo 'callback change()', PHP_EOL;}); }); $global_template = new \V8\ObjectTemplate($isolate); -$global_template->Set(new \V8\StringValue($isolate, 'test'), $test_func_tpl); -$global_template->Set(new \V8\StringValue($isolate, 'change'), $change_func_tpl); +$global_template->set(new \V8\StringValue($isolate, 'test'), $test_func_tpl); +$global_template->set(new \V8\StringValue($isolate, 'change'), $change_func_tpl); $context = new \V8\Context($isolate, $global_template); @@ -42,7 +42,7 @@ $file_name = 'test.js'; $script = new \V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); try { - $helper->dump($script->Run($context)->ToString($context)->Value()); + $helper->dump($script->run($context)->toString($context)->value()); } catch (Exception $e) { $helper->exception_export($e); } @@ -52,7 +52,7 @@ echo 'We are done for now', PHP_EOL; ?> EOF --EXPECT-- -TypeError: Argument 1 passed to V8\FunctionTemplate::SetCallHandler() must be callable, null given +TypeError: Argument 1 passed to V8\FunctionTemplate::setCallHandler() must be callable, null given callback test() V8\Exceptions\Exception: v8::FunctionTemplate::SetCallHandler FunctionTemplate already instantiated diff --git a/tests/V8FunctionTemplate_weakness.phpt b/tests/V8FunctionTemplate_weakness.phpt index a23402f..5a7e92c 100644 --- a/tests/V8FunctionTemplate_weakness.phpt +++ b/tests/V8FunctionTemplate_weakness.phpt @@ -69,7 +69,7 @@ class MyCallaback $print_func_tpl = new MyFunctionTemplate($isolate, new MyCallaback()); $global_template = new MyObjectTemplate($isolate); -$global_template->Set(new \V8\StringValue($isolate, 'print'), $print_func_tpl); +$global_template->set(new \V8\StringValue($isolate, 'print'), $print_func_tpl); $print_func_tpl = null; $context = new Context($isolate, $global_template); @@ -80,7 +80,7 @@ $file_name = 'test.js'; try { $script = new Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); - $script->Run($context)->Value(); + $script->run($context)->value(); } catch (Exception $e) { $helper->exception_export($e); } diff --git a/tests/V8Int32Value.phpt b/tests/V8Int32Value.phpt index cb04dc0..e84cc6b 100644 --- a/tests/V8Int32Value.phpt +++ b/tests/V8Int32Value.phpt @@ -26,8 +26,8 @@ $helper->assert('Int32Value extends IntegerValue', $value instanceof \V8\Integer $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_export($value, 'Value'); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_export($value, 'value'); $helper->space(); @@ -38,25 +38,25 @@ $global_template = new \V8\ObjectTemplate($isolate); $context = new \V8\Context($isolate, $global_template); -$string = $value->ToString($context); +$string = $value->toString($context); -$helper->header(get_class($value) .'::ToString() converting'); +$helper->header(get_class($value) .'::toString() converting'); $helper->dump($string); -$helper->dump($string->Value()); +$helper->dump($string->value()); $helper->space(); $helper->header('Primitive converters'); -$helper->method_export($value, 'BooleanValue', [$context]); -$helper->method_export($value, 'NumberValue', [$context]); +$helper->method_export($value, 'booleanValue', [$context]); +$helper->method_export($value, 'numberValue', [$context]); $helper->space(); $helper->header('Test negative value in constructor'); $value = new V8\Int32Value($isolate, -123.456); -$helper->method_export($value, 'Value'); -$helper->method_export($value, 'BooleanValue', [$context]); -$helper->method_export($value, 'NumberValue', [$context]); +$helper->method_export($value, 'value'); +$helper->method_export($value, 'booleanValue', [$context]); +$helper->method_export($value, 'numberValue', [$context]); $helper->space(); $v8_helper->run_checks($value, 'Checkers for negative'); @@ -68,7 +68,7 @@ foreach ([PHP_INT_MAX, -PHP_INT_MAX, NAN, INF, -INF] as $val) { $helper->value_export($val); try { $value = new V8\Int32Value($isolate, $val); - $helper->method_export($value, 'Value'); + $helper->method_export($value, 'value'); } catch (Throwable $e) { $helper->exception_export($e); } @@ -91,65 +91,65 @@ Int32Value extends IntegerValue: ok Accessors: ---------- -V8\Int32Value::GetIsolate() matches expected value -V8\Int32Value->Value(): int(2147483646) +V8\Int32Value::getIsolate() matches expected value +V8\Int32Value->value(): int(2147483646) Checkers: --------- -V8\Int32Value(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "number" - -V8\Int32Value(V8\Value)->IsUndefined(): bool(false) -V8\Int32Value(V8\Value)->IsNull(): bool(false) -V8\Int32Value(V8\Value)->IsNullOrUndefined(): bool(false) -V8\Int32Value(V8\Value)->IsTrue(): bool(false) -V8\Int32Value(V8\Value)->IsFalse(): bool(false) -V8\Int32Value(V8\Value)->IsName(): bool(false) -V8\Int32Value(V8\Value)->IsString(): bool(false) -V8\Int32Value(V8\Value)->IsSymbol(): bool(false) -V8\Int32Value(V8\Value)->IsFunction(): bool(false) -V8\Int32Value(V8\Value)->IsArray(): bool(false) -V8\Int32Value(V8\Value)->IsObject(): bool(false) -V8\Int32Value(V8\Value)->IsBoolean(): bool(false) -V8\Int32Value(V8\Value)->IsNumber(): bool(true) -V8\Int32Value(V8\Value)->IsInt32(): bool(true) -V8\Int32Value(V8\Value)->IsUint32(): bool(true) -V8\Int32Value(V8\Value)->IsDate(): bool(false) -V8\Int32Value(V8\Value)->IsArgumentsObject(): bool(false) -V8\Int32Value(V8\Value)->IsBooleanObject(): bool(false) -V8\Int32Value(V8\Value)->IsNumberObject(): bool(false) -V8\Int32Value(V8\Value)->IsStringObject(): bool(false) -V8\Int32Value(V8\Value)->IsSymbolObject(): bool(false) -V8\Int32Value(V8\Value)->IsNativeError(): bool(false) -V8\Int32Value(V8\Value)->IsRegExp(): bool(false) -V8\Int32Value(V8\Value)->IsAsyncFunction(): bool(false) -V8\Int32Value(V8\Value)->IsGeneratorFunction(): bool(false) -V8\Int32Value(V8\Value)->IsGeneratorObject(): bool(false) -V8\Int32Value(V8\Value)->IsPromise(): bool(false) -V8\Int32Value(V8\Value)->IsMap(): bool(false) -V8\Int32Value(V8\Value)->IsSet(): bool(false) -V8\Int32Value(V8\Value)->IsMapIterator(): bool(false) -V8\Int32Value(V8\Value)->IsSetIterator(): bool(false) -V8\Int32Value(V8\Value)->IsWeakMap(): bool(false) -V8\Int32Value(V8\Value)->IsWeakSet(): bool(false) -V8\Int32Value(V8\Value)->IsArrayBuffer(): bool(false) -V8\Int32Value(V8\Value)->IsArrayBufferView(): bool(false) -V8\Int32Value(V8\Value)->IsTypedArray(): bool(false) -V8\Int32Value(V8\Value)->IsUint8Array(): bool(false) -V8\Int32Value(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\Int32Value(V8\Value)->IsInt8Array(): bool(false) -V8\Int32Value(V8\Value)->IsUint16Array(): bool(false) -V8\Int32Value(V8\Value)->IsInt16Array(): bool(false) -V8\Int32Value(V8\Value)->IsUint32Array(): bool(false) -V8\Int32Value(V8\Value)->IsInt32Array(): bool(false) -V8\Int32Value(V8\Value)->IsFloat32Array(): bool(false) -V8\Int32Value(V8\Value)->IsFloat64Array(): bool(false) -V8\Int32Value(V8\Value)->IsDataView(): bool(false) -V8\Int32Value(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\Int32Value(V8\Value)->IsProxy(): bool(false) - - -V8\Int32Value::ToString() converting: +V8\Int32Value(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "number" + +V8\Int32Value(V8\Value)->isUndefined(): bool(false) +V8\Int32Value(V8\Value)->isNull(): bool(false) +V8\Int32Value(V8\Value)->isNullOrUndefined(): bool(false) +V8\Int32Value(V8\Value)->isTrue(): bool(false) +V8\Int32Value(V8\Value)->isFalse(): bool(false) +V8\Int32Value(V8\Value)->isName(): bool(false) +V8\Int32Value(V8\Value)->isString(): bool(false) +V8\Int32Value(V8\Value)->isSymbol(): bool(false) +V8\Int32Value(V8\Value)->isFunction(): bool(false) +V8\Int32Value(V8\Value)->isArray(): bool(false) +V8\Int32Value(V8\Value)->isObject(): bool(false) +V8\Int32Value(V8\Value)->isBoolean(): bool(false) +V8\Int32Value(V8\Value)->isNumber(): bool(true) +V8\Int32Value(V8\Value)->isInt32(): bool(true) +V8\Int32Value(V8\Value)->isUint32(): bool(true) +V8\Int32Value(V8\Value)->isDate(): bool(false) +V8\Int32Value(V8\Value)->isArgumentsObject(): bool(false) +V8\Int32Value(V8\Value)->isBooleanObject(): bool(false) +V8\Int32Value(V8\Value)->isNumberObject(): bool(false) +V8\Int32Value(V8\Value)->isStringObject(): bool(false) +V8\Int32Value(V8\Value)->isSymbolObject(): bool(false) +V8\Int32Value(V8\Value)->isNativeError(): bool(false) +V8\Int32Value(V8\Value)->isRegExp(): bool(false) +V8\Int32Value(V8\Value)->isAsyncFunction(): bool(false) +V8\Int32Value(V8\Value)->isGeneratorFunction(): bool(false) +V8\Int32Value(V8\Value)->isGeneratorObject(): bool(false) +V8\Int32Value(V8\Value)->isPromise(): bool(false) +V8\Int32Value(V8\Value)->isMap(): bool(false) +V8\Int32Value(V8\Value)->isSet(): bool(false) +V8\Int32Value(V8\Value)->isMapIterator(): bool(false) +V8\Int32Value(V8\Value)->isSetIterator(): bool(false) +V8\Int32Value(V8\Value)->isWeakMap(): bool(false) +V8\Int32Value(V8\Value)->isWeakSet(): bool(false) +V8\Int32Value(V8\Value)->isArrayBuffer(): bool(false) +V8\Int32Value(V8\Value)->isArrayBufferView(): bool(false) +V8\Int32Value(V8\Value)->isTypedArray(): bool(false) +V8\Int32Value(V8\Value)->isUint8Array(): bool(false) +V8\Int32Value(V8\Value)->isUint8ClampedArray(): bool(false) +V8\Int32Value(V8\Value)->isInt8Array(): bool(false) +V8\Int32Value(V8\Value)->isUint16Array(): bool(false) +V8\Int32Value(V8\Value)->isInt16Array(): bool(false) +V8\Int32Value(V8\Value)->isUint32Array(): bool(false) +V8\Int32Value(V8\Value)->isInt32Array(): bool(false) +V8\Int32Value(V8\Value)->isFloat32Array(): bool(false) +V8\Int32Value(V8\Value)->isFloat64Array(): bool(false) +V8\Int32Value(V8\Value)->isDataView(): bool(false) +V8\Int32Value(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\Int32Value(V8\Value)->isProxy(): bool(false) + + +V8\Int32Value::toString() converting: ------------------------------------- object(V8\StringValue)#79 (1) { ["isolate":"V8\Value":private]=> @@ -161,69 +161,69 @@ string(10) "2147483646" Primitive converters: --------------------- -V8\Int32Value(V8\Value)->BooleanValue(): bool(true) -V8\Int32Value(V8\Value)->NumberValue(): float(2147483646) +V8\Int32Value(V8\Value)->booleanValue(): bool(true) +V8\Int32Value(V8\Value)->numberValue(): float(2147483646) Test negative value in constructor: ----------------------------------- -V8\Int32Value->Value(): int(-123) -V8\Int32Value(V8\Value)->BooleanValue(): bool(true) -V8\Int32Value(V8\Value)->NumberValue(): float(-123) +V8\Int32Value->value(): int(-123) +V8\Int32Value(V8\Value)->booleanValue(): bool(true) +V8\Int32Value(V8\Value)->numberValue(): float(-123) Checkers for negative: ---------------------- -V8\Int32Value(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "number" - -V8\Int32Value(V8\Value)->IsUndefined(): bool(false) -V8\Int32Value(V8\Value)->IsNull(): bool(false) -V8\Int32Value(V8\Value)->IsNullOrUndefined(): bool(false) -V8\Int32Value(V8\Value)->IsTrue(): bool(false) -V8\Int32Value(V8\Value)->IsFalse(): bool(false) -V8\Int32Value(V8\Value)->IsName(): bool(false) -V8\Int32Value(V8\Value)->IsString(): bool(false) -V8\Int32Value(V8\Value)->IsSymbol(): bool(false) -V8\Int32Value(V8\Value)->IsFunction(): bool(false) -V8\Int32Value(V8\Value)->IsArray(): bool(false) -V8\Int32Value(V8\Value)->IsObject(): bool(false) -V8\Int32Value(V8\Value)->IsBoolean(): bool(false) -V8\Int32Value(V8\Value)->IsNumber(): bool(true) -V8\Int32Value(V8\Value)->IsInt32(): bool(true) -V8\Int32Value(V8\Value)->IsUint32(): bool(false) -V8\Int32Value(V8\Value)->IsDate(): bool(false) -V8\Int32Value(V8\Value)->IsArgumentsObject(): bool(false) -V8\Int32Value(V8\Value)->IsBooleanObject(): bool(false) -V8\Int32Value(V8\Value)->IsNumberObject(): bool(false) -V8\Int32Value(V8\Value)->IsStringObject(): bool(false) -V8\Int32Value(V8\Value)->IsSymbolObject(): bool(false) -V8\Int32Value(V8\Value)->IsNativeError(): bool(false) -V8\Int32Value(V8\Value)->IsRegExp(): bool(false) -V8\Int32Value(V8\Value)->IsAsyncFunction(): bool(false) -V8\Int32Value(V8\Value)->IsGeneratorFunction(): bool(false) -V8\Int32Value(V8\Value)->IsGeneratorObject(): bool(false) -V8\Int32Value(V8\Value)->IsPromise(): bool(false) -V8\Int32Value(V8\Value)->IsMap(): bool(false) -V8\Int32Value(V8\Value)->IsSet(): bool(false) -V8\Int32Value(V8\Value)->IsMapIterator(): bool(false) -V8\Int32Value(V8\Value)->IsSetIterator(): bool(false) -V8\Int32Value(V8\Value)->IsWeakMap(): bool(false) -V8\Int32Value(V8\Value)->IsWeakSet(): bool(false) -V8\Int32Value(V8\Value)->IsArrayBuffer(): bool(false) -V8\Int32Value(V8\Value)->IsArrayBufferView(): bool(false) -V8\Int32Value(V8\Value)->IsTypedArray(): bool(false) -V8\Int32Value(V8\Value)->IsUint8Array(): bool(false) -V8\Int32Value(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\Int32Value(V8\Value)->IsInt8Array(): bool(false) -V8\Int32Value(V8\Value)->IsUint16Array(): bool(false) -V8\Int32Value(V8\Value)->IsInt16Array(): bool(false) -V8\Int32Value(V8\Value)->IsUint32Array(): bool(false) -V8\Int32Value(V8\Value)->IsInt32Array(): bool(false) -V8\Int32Value(V8\Value)->IsFloat32Array(): bool(false) -V8\Int32Value(V8\Value)->IsFloat64Array(): bool(false) -V8\Int32Value(V8\Value)->IsDataView(): bool(false) -V8\Int32Value(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\Int32Value(V8\Value)->IsProxy(): bool(false) +V8\Int32Value(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "number" + +V8\Int32Value(V8\Value)->isUndefined(): bool(false) +V8\Int32Value(V8\Value)->isNull(): bool(false) +V8\Int32Value(V8\Value)->isNullOrUndefined(): bool(false) +V8\Int32Value(V8\Value)->isTrue(): bool(false) +V8\Int32Value(V8\Value)->isFalse(): bool(false) +V8\Int32Value(V8\Value)->isName(): bool(false) +V8\Int32Value(V8\Value)->isString(): bool(false) +V8\Int32Value(V8\Value)->isSymbol(): bool(false) +V8\Int32Value(V8\Value)->isFunction(): bool(false) +V8\Int32Value(V8\Value)->isArray(): bool(false) +V8\Int32Value(V8\Value)->isObject(): bool(false) +V8\Int32Value(V8\Value)->isBoolean(): bool(false) +V8\Int32Value(V8\Value)->isNumber(): bool(true) +V8\Int32Value(V8\Value)->isInt32(): bool(true) +V8\Int32Value(V8\Value)->isUint32(): bool(false) +V8\Int32Value(V8\Value)->isDate(): bool(false) +V8\Int32Value(V8\Value)->isArgumentsObject(): bool(false) +V8\Int32Value(V8\Value)->isBooleanObject(): bool(false) +V8\Int32Value(V8\Value)->isNumberObject(): bool(false) +V8\Int32Value(V8\Value)->isStringObject(): bool(false) +V8\Int32Value(V8\Value)->isSymbolObject(): bool(false) +V8\Int32Value(V8\Value)->isNativeError(): bool(false) +V8\Int32Value(V8\Value)->isRegExp(): bool(false) +V8\Int32Value(V8\Value)->isAsyncFunction(): bool(false) +V8\Int32Value(V8\Value)->isGeneratorFunction(): bool(false) +V8\Int32Value(V8\Value)->isGeneratorObject(): bool(false) +V8\Int32Value(V8\Value)->isPromise(): bool(false) +V8\Int32Value(V8\Value)->isMap(): bool(false) +V8\Int32Value(V8\Value)->isSet(): bool(false) +V8\Int32Value(V8\Value)->isMapIterator(): bool(false) +V8\Int32Value(V8\Value)->isSetIterator(): bool(false) +V8\Int32Value(V8\Value)->isWeakMap(): bool(false) +V8\Int32Value(V8\Value)->isWeakSet(): bool(false) +V8\Int32Value(V8\Value)->isArrayBuffer(): bool(false) +V8\Int32Value(V8\Value)->isArrayBufferView(): bool(false) +V8\Int32Value(V8\Value)->isTypedArray(): bool(false) +V8\Int32Value(V8\Value)->isUint8Array(): bool(false) +V8\Int32Value(V8\Value)->isUint8ClampedArray(): bool(false) +V8\Int32Value(V8\Value)->isInt8Array(): bool(false) +V8\Int32Value(V8\Value)->isUint16Array(): bool(false) +V8\Int32Value(V8\Value)->isInt16Array(): bool(false) +V8\Int32Value(V8\Value)->isUint32Array(): bool(false) +V8\Int32Value(V8\Value)->isInt32Array(): bool(false) +V8\Int32Value(V8\Value)->isFloat32Array(): bool(false) +V8\Int32Value(V8\Value)->isFloat64Array(): bool(false) +V8\Int32Value(V8\Value)->isDataView(): bool(false) +V8\Int32Value(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\Int32Value(V8\Value)->isProxy(): bool(false) Int32 is same as Integer - int32, so test for out-of-range (INT32_MIN-INT32_MAX): diff --git a/tests/V8IntegerValue.phpt b/tests/V8IntegerValue.phpt index 68986e4..38b9708 100644 --- a/tests/V8IntegerValue.phpt +++ b/tests/V8IntegerValue.phpt @@ -26,8 +26,8 @@ $helper->assert('IntegerValue extends NumberValue', $value instanceof \V8\Number $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_export($value, 'Value'); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_export($value, 'value'); $helper->space(); @@ -38,25 +38,25 @@ $global_template = new \V8\ObjectTemplate($isolate); $context = new \V8\Context($isolate, $global_template); -$string = $value->ToString($context); +$string = $value->toString($context); -$helper->header(get_class($value) .'::ToString() converting'); +$helper->header(get_class($value) .'::toString() converting'); $helper->dump($string); -$helper->dump($string->Value()); +$helper->dump($string->value()); $helper->space(); $helper->header('Primitive converters'); -$helper->method_export($value, 'BooleanValue', [$context]); -$helper->method_export($value, 'NumberValue', [$context]); +$helper->method_export($value, 'booleanValue', [$context]); +$helper->method_export($value, 'numberValue', [$context]); $helper->space(); $helper->header('Test negative value in constructor'); $value = new V8\IntegerValue($isolate, -123.456); -$helper->method_export($value, 'Value'); -$helper->method_export($value, 'BooleanValue', [$context]); -$helper->method_export($value, 'NumberValue', [$context]); +$helper->method_export($value, 'value'); +$helper->method_export($value, 'booleanValue', [$context]); +$helper->method_export($value, 'numberValue', [$context]); $helper->space(); $v8_helper->run_checks($value, 'Checkers for negative'); @@ -68,7 +68,7 @@ foreach ([PHP_INT_MAX, -PHP_INT_MAX, NAN, INF, -INF] as $val) { $helper->value_export($val); try { $value = new V8\IntegerValue($isolate, $val); - $helper->method_export($value, 'Value'); + $helper->method_export($value, 'value'); } catch (Throwable $e) { $helper->exception_export($e); } @@ -91,65 +91,65 @@ IntegerValue extends NumberValue: ok Accessors: ---------- -V8\IntegerValue::GetIsolate() matches expected value -V8\IntegerValue->Value(): int(123) +V8\IntegerValue::getIsolate() matches expected value +V8\IntegerValue->value(): int(123) Checkers: --------- -V8\IntegerValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "number" - -V8\IntegerValue(V8\Value)->IsUndefined(): bool(false) -V8\IntegerValue(V8\Value)->IsNull(): bool(false) -V8\IntegerValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\IntegerValue(V8\Value)->IsTrue(): bool(false) -V8\IntegerValue(V8\Value)->IsFalse(): bool(false) -V8\IntegerValue(V8\Value)->IsName(): bool(false) -V8\IntegerValue(V8\Value)->IsString(): bool(false) -V8\IntegerValue(V8\Value)->IsSymbol(): bool(false) -V8\IntegerValue(V8\Value)->IsFunction(): bool(false) -V8\IntegerValue(V8\Value)->IsArray(): bool(false) -V8\IntegerValue(V8\Value)->IsObject(): bool(false) -V8\IntegerValue(V8\Value)->IsBoolean(): bool(false) -V8\IntegerValue(V8\Value)->IsNumber(): bool(true) -V8\IntegerValue(V8\Value)->IsInt32(): bool(true) -V8\IntegerValue(V8\Value)->IsUint32(): bool(true) -V8\IntegerValue(V8\Value)->IsDate(): bool(false) -V8\IntegerValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\IntegerValue(V8\Value)->IsBooleanObject(): bool(false) -V8\IntegerValue(V8\Value)->IsNumberObject(): bool(false) -V8\IntegerValue(V8\Value)->IsStringObject(): bool(false) -V8\IntegerValue(V8\Value)->IsSymbolObject(): bool(false) -V8\IntegerValue(V8\Value)->IsNativeError(): bool(false) -V8\IntegerValue(V8\Value)->IsRegExp(): bool(false) -V8\IntegerValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\IntegerValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\IntegerValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\IntegerValue(V8\Value)->IsPromise(): bool(false) -V8\IntegerValue(V8\Value)->IsMap(): bool(false) -V8\IntegerValue(V8\Value)->IsSet(): bool(false) -V8\IntegerValue(V8\Value)->IsMapIterator(): bool(false) -V8\IntegerValue(V8\Value)->IsSetIterator(): bool(false) -V8\IntegerValue(V8\Value)->IsWeakMap(): bool(false) -V8\IntegerValue(V8\Value)->IsWeakSet(): bool(false) -V8\IntegerValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\IntegerValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\IntegerValue(V8\Value)->IsTypedArray(): bool(false) -V8\IntegerValue(V8\Value)->IsUint8Array(): bool(false) -V8\IntegerValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\IntegerValue(V8\Value)->IsInt8Array(): bool(false) -V8\IntegerValue(V8\Value)->IsUint16Array(): bool(false) -V8\IntegerValue(V8\Value)->IsInt16Array(): bool(false) -V8\IntegerValue(V8\Value)->IsUint32Array(): bool(false) -V8\IntegerValue(V8\Value)->IsInt32Array(): bool(false) -V8\IntegerValue(V8\Value)->IsFloat32Array(): bool(false) -V8\IntegerValue(V8\Value)->IsFloat64Array(): bool(false) -V8\IntegerValue(V8\Value)->IsDataView(): bool(false) -V8\IntegerValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\IntegerValue(V8\Value)->IsProxy(): bool(false) - - -V8\IntegerValue::ToString() converting: +V8\IntegerValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "number" + +V8\IntegerValue(V8\Value)->isUndefined(): bool(false) +V8\IntegerValue(V8\Value)->isNull(): bool(false) +V8\IntegerValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\IntegerValue(V8\Value)->isTrue(): bool(false) +V8\IntegerValue(V8\Value)->isFalse(): bool(false) +V8\IntegerValue(V8\Value)->isName(): bool(false) +V8\IntegerValue(V8\Value)->isString(): bool(false) +V8\IntegerValue(V8\Value)->isSymbol(): bool(false) +V8\IntegerValue(V8\Value)->isFunction(): bool(false) +V8\IntegerValue(V8\Value)->isArray(): bool(false) +V8\IntegerValue(V8\Value)->isObject(): bool(false) +V8\IntegerValue(V8\Value)->isBoolean(): bool(false) +V8\IntegerValue(V8\Value)->isNumber(): bool(true) +V8\IntegerValue(V8\Value)->isInt32(): bool(true) +V8\IntegerValue(V8\Value)->isUint32(): bool(true) +V8\IntegerValue(V8\Value)->isDate(): bool(false) +V8\IntegerValue(V8\Value)->isArgumentsObject(): bool(false) +V8\IntegerValue(V8\Value)->isBooleanObject(): bool(false) +V8\IntegerValue(V8\Value)->isNumberObject(): bool(false) +V8\IntegerValue(V8\Value)->isStringObject(): bool(false) +V8\IntegerValue(V8\Value)->isSymbolObject(): bool(false) +V8\IntegerValue(V8\Value)->isNativeError(): bool(false) +V8\IntegerValue(V8\Value)->isRegExp(): bool(false) +V8\IntegerValue(V8\Value)->isAsyncFunction(): bool(false) +V8\IntegerValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\IntegerValue(V8\Value)->isGeneratorObject(): bool(false) +V8\IntegerValue(V8\Value)->isPromise(): bool(false) +V8\IntegerValue(V8\Value)->isMap(): bool(false) +V8\IntegerValue(V8\Value)->isSet(): bool(false) +V8\IntegerValue(V8\Value)->isMapIterator(): bool(false) +V8\IntegerValue(V8\Value)->isSetIterator(): bool(false) +V8\IntegerValue(V8\Value)->isWeakMap(): bool(false) +V8\IntegerValue(V8\Value)->isWeakSet(): bool(false) +V8\IntegerValue(V8\Value)->isArrayBuffer(): bool(false) +V8\IntegerValue(V8\Value)->isArrayBufferView(): bool(false) +V8\IntegerValue(V8\Value)->isTypedArray(): bool(false) +V8\IntegerValue(V8\Value)->isUint8Array(): bool(false) +V8\IntegerValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\IntegerValue(V8\Value)->isInt8Array(): bool(false) +V8\IntegerValue(V8\Value)->isUint16Array(): bool(false) +V8\IntegerValue(V8\Value)->isInt16Array(): bool(false) +V8\IntegerValue(V8\Value)->isUint32Array(): bool(false) +V8\IntegerValue(V8\Value)->isInt32Array(): bool(false) +V8\IntegerValue(V8\Value)->isFloat32Array(): bool(false) +V8\IntegerValue(V8\Value)->isFloat64Array(): bool(false) +V8\IntegerValue(V8\Value)->isDataView(): bool(false) +V8\IntegerValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\IntegerValue(V8\Value)->isProxy(): bool(false) + + +V8\IntegerValue::toString() converting: --------------------------------------- object(V8\StringValue)#79 (1) { ["isolate":"V8\Value":private]=> @@ -161,69 +161,69 @@ string(3) "123" Primitive converters: --------------------- -V8\IntegerValue(V8\Value)->BooleanValue(): bool(true) -V8\IntegerValue(V8\Value)->NumberValue(): float(123) +V8\IntegerValue(V8\Value)->booleanValue(): bool(true) +V8\IntegerValue(V8\Value)->numberValue(): float(123) Test negative value in constructor: ----------------------------------- -V8\IntegerValue->Value(): int(-123) -V8\IntegerValue(V8\Value)->BooleanValue(): bool(true) -V8\IntegerValue(V8\Value)->NumberValue(): float(-123) +V8\IntegerValue->value(): int(-123) +V8\IntegerValue(V8\Value)->booleanValue(): bool(true) +V8\IntegerValue(V8\Value)->numberValue(): float(-123) Checkers for negative: ---------------------- -V8\IntegerValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "number" - -V8\IntegerValue(V8\Value)->IsUndefined(): bool(false) -V8\IntegerValue(V8\Value)->IsNull(): bool(false) -V8\IntegerValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\IntegerValue(V8\Value)->IsTrue(): bool(false) -V8\IntegerValue(V8\Value)->IsFalse(): bool(false) -V8\IntegerValue(V8\Value)->IsName(): bool(false) -V8\IntegerValue(V8\Value)->IsString(): bool(false) -V8\IntegerValue(V8\Value)->IsSymbol(): bool(false) -V8\IntegerValue(V8\Value)->IsFunction(): bool(false) -V8\IntegerValue(V8\Value)->IsArray(): bool(false) -V8\IntegerValue(V8\Value)->IsObject(): bool(false) -V8\IntegerValue(V8\Value)->IsBoolean(): bool(false) -V8\IntegerValue(V8\Value)->IsNumber(): bool(true) -V8\IntegerValue(V8\Value)->IsInt32(): bool(true) -V8\IntegerValue(V8\Value)->IsUint32(): bool(false) -V8\IntegerValue(V8\Value)->IsDate(): bool(false) -V8\IntegerValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\IntegerValue(V8\Value)->IsBooleanObject(): bool(false) -V8\IntegerValue(V8\Value)->IsNumberObject(): bool(false) -V8\IntegerValue(V8\Value)->IsStringObject(): bool(false) -V8\IntegerValue(V8\Value)->IsSymbolObject(): bool(false) -V8\IntegerValue(V8\Value)->IsNativeError(): bool(false) -V8\IntegerValue(V8\Value)->IsRegExp(): bool(false) -V8\IntegerValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\IntegerValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\IntegerValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\IntegerValue(V8\Value)->IsPromise(): bool(false) -V8\IntegerValue(V8\Value)->IsMap(): bool(false) -V8\IntegerValue(V8\Value)->IsSet(): bool(false) -V8\IntegerValue(V8\Value)->IsMapIterator(): bool(false) -V8\IntegerValue(V8\Value)->IsSetIterator(): bool(false) -V8\IntegerValue(V8\Value)->IsWeakMap(): bool(false) -V8\IntegerValue(V8\Value)->IsWeakSet(): bool(false) -V8\IntegerValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\IntegerValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\IntegerValue(V8\Value)->IsTypedArray(): bool(false) -V8\IntegerValue(V8\Value)->IsUint8Array(): bool(false) -V8\IntegerValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\IntegerValue(V8\Value)->IsInt8Array(): bool(false) -V8\IntegerValue(V8\Value)->IsUint16Array(): bool(false) -V8\IntegerValue(V8\Value)->IsInt16Array(): bool(false) -V8\IntegerValue(V8\Value)->IsUint32Array(): bool(false) -V8\IntegerValue(V8\Value)->IsInt32Array(): bool(false) -V8\IntegerValue(V8\Value)->IsFloat32Array(): bool(false) -V8\IntegerValue(V8\Value)->IsFloat64Array(): bool(false) -V8\IntegerValue(V8\Value)->IsDataView(): bool(false) -V8\IntegerValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\IntegerValue(V8\Value)->IsProxy(): bool(false) +V8\IntegerValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "number" + +V8\IntegerValue(V8\Value)->isUndefined(): bool(false) +V8\IntegerValue(V8\Value)->isNull(): bool(false) +V8\IntegerValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\IntegerValue(V8\Value)->isTrue(): bool(false) +V8\IntegerValue(V8\Value)->isFalse(): bool(false) +V8\IntegerValue(V8\Value)->isName(): bool(false) +V8\IntegerValue(V8\Value)->isString(): bool(false) +V8\IntegerValue(V8\Value)->isSymbol(): bool(false) +V8\IntegerValue(V8\Value)->isFunction(): bool(false) +V8\IntegerValue(V8\Value)->isArray(): bool(false) +V8\IntegerValue(V8\Value)->isObject(): bool(false) +V8\IntegerValue(V8\Value)->isBoolean(): bool(false) +V8\IntegerValue(V8\Value)->isNumber(): bool(true) +V8\IntegerValue(V8\Value)->isInt32(): bool(true) +V8\IntegerValue(V8\Value)->isUint32(): bool(false) +V8\IntegerValue(V8\Value)->isDate(): bool(false) +V8\IntegerValue(V8\Value)->isArgumentsObject(): bool(false) +V8\IntegerValue(V8\Value)->isBooleanObject(): bool(false) +V8\IntegerValue(V8\Value)->isNumberObject(): bool(false) +V8\IntegerValue(V8\Value)->isStringObject(): bool(false) +V8\IntegerValue(V8\Value)->isSymbolObject(): bool(false) +V8\IntegerValue(V8\Value)->isNativeError(): bool(false) +V8\IntegerValue(V8\Value)->isRegExp(): bool(false) +V8\IntegerValue(V8\Value)->isAsyncFunction(): bool(false) +V8\IntegerValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\IntegerValue(V8\Value)->isGeneratorObject(): bool(false) +V8\IntegerValue(V8\Value)->isPromise(): bool(false) +V8\IntegerValue(V8\Value)->isMap(): bool(false) +V8\IntegerValue(V8\Value)->isSet(): bool(false) +V8\IntegerValue(V8\Value)->isMapIterator(): bool(false) +V8\IntegerValue(V8\Value)->isSetIterator(): bool(false) +V8\IntegerValue(V8\Value)->isWeakMap(): bool(false) +V8\IntegerValue(V8\Value)->isWeakSet(): bool(false) +V8\IntegerValue(V8\Value)->isArrayBuffer(): bool(false) +V8\IntegerValue(V8\Value)->isArrayBufferView(): bool(false) +V8\IntegerValue(V8\Value)->isTypedArray(): bool(false) +V8\IntegerValue(V8\Value)->isUint8Array(): bool(false) +V8\IntegerValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\IntegerValue(V8\Value)->isInt8Array(): bool(false) +V8\IntegerValue(V8\Value)->isUint16Array(): bool(false) +V8\IntegerValue(V8\Value)->isInt16Array(): bool(false) +V8\IntegerValue(V8\Value)->isUint32Array(): bool(false) +V8\IntegerValue(V8\Value)->isInt32Array(): bool(false) +V8\IntegerValue(V8\Value)->isFloat32Array(): bool(false) +V8\IntegerValue(V8\Value)->isFloat64Array(): bool(false) +V8\IntegerValue(V8\Value)->isDataView(): bool(false) +V8\IntegerValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\IntegerValue(V8\Value)->isProxy(): bool(false) Integer is int32, so test for out-of-range (INT32_MIN-INT32_MAX): diff --git a/tests/V8Isolate.phpt b/tests/V8Isolate.phpt index 926cfbd..70ee1d8 100644 --- a/tests/V8Isolate.phpt +++ b/tests/V8Isolate.phpt @@ -16,7 +16,7 @@ $helper->header('Object representation'); $helper->dump($isolate); $helper->line(); -$helper->method_export($isolate, 'GetHeapStatistics'); +$helper->method_export($isolate, 'getHeapStatistics'); $isolate = null; @@ -29,7 +29,7 @@ Object representation: object(V8\Isolate)#2 (0) { } -V8\Isolate->GetHeapStatistics(): +V8\Isolate->getHeapStatistics(): object(V8\HeapStatistics)#26 (9) { ["total_heap_size":"V8\HeapStatistics":private]=> float(%f) diff --git a/tests/V8Isolate_ThrowException.phpt b/tests/V8Isolate_ThrowException.phpt deleted file mode 100644 index 4bb4460..0000000 --- a/tests/V8Isolate_ThrowException.phpt +++ /dev/null @@ -1,278 +0,0 @@ ---TEST-- -V8\Isolate::ThrowException() ---SKIPIF-- - ---FILE-- -Arguments()) ? $info->Arguments()[0] : new \V8\StringValue($info->GetIsolate(), "exception"); - - $info->GetIsolate()->ThrowException($info->GetContext(), $value); -}); - - -$global_tpl = new \V8\ObjectTemplate($isolate); -$global_tpl->Set(new \V8\StringValue($isolate, 'e'), $func_tpl); - -$context = new \V8\Context($isolate, $global_tpl); -$v8_helper->injectConsoleLog($context); - - -$v8_helper->CompileTryRun($context, 'e()'); -$v8_helper->CompileTryRun($context, 'e("test")'); - - -$source = ' - var ex; - - try { - e("foo"); - } catch (exception) { - console.log("exception: ", "\'", exception, "\'"); - console.log("exception.stack: ", exception.stack); - ex = exception; - } - - ex -'; - -$helper->line(); - -$res = $v8_helper->CompileRun($context, $source); -$helper->line(); -$v8_helper->CHECK($res->StrictEquals(new \V8\StringValue($isolate, 'foo')), '$res->StrictEquals(new \V8\StringValue($isolate, \'foo\'))'); -$helper->line(); - -$v8_helper->run_checks($res); - - -$source = ' - var ex; - - try { - e({}); - } catch (exception) { - console.log("exception: ", "\'", exception, "\'"); - console.log("exception.stack: ", exception.stack); - ex = exception; - } - - ex -'; - -$res = $v8_helper->CompileRun($context, $source); -$helper->line(); - -$v8_helper->run_checks($res); - -$source = ' - var ex; - - try { - throw new Error(); - } catch (exception) { - console.log("exception: ", "\'", exception, "\'"); - console.log("exception.stack: ", exception.stack); - ex = exception; - } - - ex -'; - -$res = $v8_helper->CompileRun($context, $source); -$helper->line(); - -$v8_helper->run_checks($res); - - -?> ---EXPECT-- -e(): V8\Exceptions\TryCatchException: exception -e("test"): V8\Exceptions\TryCatchException: test - -exception: 'foo' -exception.stack: - -CHECK $res->StrictEquals(new \V8\StringValue($isolate, 'foo')): OK - -Checks on V8\StringValue: -------------------------- -V8\StringValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "string" - -V8\StringValue->IsOneByte(): bool(true) -V8\StringValue(V8\Value)->IsUndefined(): bool(false) -V8\StringValue(V8\Value)->IsNull(): bool(false) -V8\StringValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\StringValue(V8\Value)->IsTrue(): bool(false) -V8\StringValue(V8\Value)->IsFalse(): bool(false) -V8\StringValue(V8\Value)->IsName(): bool(true) -V8\StringValue(V8\Value)->IsString(): bool(true) -V8\StringValue(V8\Value)->IsSymbol(): bool(false) -V8\StringValue(V8\Value)->IsFunction(): bool(false) -V8\StringValue(V8\Value)->IsArray(): bool(false) -V8\StringValue(V8\Value)->IsObject(): bool(false) -V8\StringValue(V8\Value)->IsBoolean(): bool(false) -V8\StringValue(V8\Value)->IsNumber(): bool(false) -V8\StringValue(V8\Value)->IsInt32(): bool(false) -V8\StringValue(V8\Value)->IsUint32(): bool(false) -V8\StringValue(V8\Value)->IsDate(): bool(false) -V8\StringValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\StringValue(V8\Value)->IsBooleanObject(): bool(false) -V8\StringValue(V8\Value)->IsNumberObject(): bool(false) -V8\StringValue(V8\Value)->IsStringObject(): bool(false) -V8\StringValue(V8\Value)->IsSymbolObject(): bool(false) -V8\StringValue(V8\Value)->IsNativeError(): bool(false) -V8\StringValue(V8\Value)->IsRegExp(): bool(false) -V8\StringValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\StringValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\StringValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\StringValue(V8\Value)->IsPromise(): bool(false) -V8\StringValue(V8\Value)->IsMap(): bool(false) -V8\StringValue(V8\Value)->IsSet(): bool(false) -V8\StringValue(V8\Value)->IsMapIterator(): bool(false) -V8\StringValue(V8\Value)->IsSetIterator(): bool(false) -V8\StringValue(V8\Value)->IsWeakMap(): bool(false) -V8\StringValue(V8\Value)->IsWeakSet(): bool(false) -V8\StringValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\StringValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\StringValue(V8\Value)->IsTypedArray(): bool(false) -V8\StringValue(V8\Value)->IsUint8Array(): bool(false) -V8\StringValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\StringValue(V8\Value)->IsInt8Array(): bool(false) -V8\StringValue(V8\Value)->IsUint16Array(): bool(false) -V8\StringValue(V8\Value)->IsInt16Array(): bool(false) -V8\StringValue(V8\Value)->IsUint32Array(): bool(false) -V8\StringValue(V8\Value)->IsInt32Array(): bool(false) -V8\StringValue(V8\Value)->IsFloat32Array(): bool(false) -V8\StringValue(V8\Value)->IsFloat64Array(): bool(false) -V8\StringValue(V8\Value)->IsDataView(): bool(false) -V8\StringValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\StringValue(V8\Value)->IsProxy(): bool(false) - - -exception: '[object Object]' -exception.stack: - -Checks on V8\ObjectValue: -------------------------- -V8\ObjectValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\ObjectValue->IsCallable(): bool(false) -V8\ObjectValue->IsConstructor(): bool(false) -V8\ObjectValue(V8\Value)->IsUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsNull(): bool(false) -V8\ObjectValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsTrue(): bool(false) -V8\ObjectValue(V8\Value)->IsFalse(): bool(false) -V8\ObjectValue(V8\Value)->IsName(): bool(false) -V8\ObjectValue(V8\Value)->IsString(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbol(): bool(false) -V8\ObjectValue(V8\Value)->IsFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsArray(): bool(false) -V8\ObjectValue(V8\Value)->IsObject(): bool(true) -V8\ObjectValue(V8\Value)->IsBoolean(): bool(false) -V8\ObjectValue(V8\Value)->IsNumber(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32(): bool(false) -V8\ObjectValue(V8\Value)->IsDate(): bool(false) -V8\ObjectValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\ObjectValue(V8\Value)->IsBooleanObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNumberObject(): bool(false) -V8\ObjectValue(V8\Value)->IsStringObject(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbolObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNativeError(): bool(false) -V8\ObjectValue(V8\Value)->IsRegExp(): bool(false) -V8\ObjectValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\ObjectValue(V8\Value)->IsPromise(): bool(false) -V8\ObjectValue(V8\Value)->IsMap(): bool(false) -V8\ObjectValue(V8\Value)->IsSet(): bool(false) -V8\ObjectValue(V8\Value)->IsMapIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsSetIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakMap(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakSet(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\ObjectValue(V8\Value)->IsTypedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsInt8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat64Array(): bool(false) -V8\ObjectValue(V8\Value)->IsDataView(): bool(false) -V8\ObjectValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsProxy(): bool(false) - - -exception: 'Error' -exception.stack: Error - at test.js:5:15 - -Checks on V8\ObjectValue: -------------------------- -V8\ObjectValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\ObjectValue->IsCallable(): bool(false) -V8\ObjectValue->IsConstructor(): bool(false) -V8\ObjectValue(V8\Value)->IsUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsNull(): bool(false) -V8\ObjectValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsTrue(): bool(false) -V8\ObjectValue(V8\Value)->IsFalse(): bool(false) -V8\ObjectValue(V8\Value)->IsName(): bool(false) -V8\ObjectValue(V8\Value)->IsString(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbol(): bool(false) -V8\ObjectValue(V8\Value)->IsFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsArray(): bool(false) -V8\ObjectValue(V8\Value)->IsObject(): bool(true) -V8\ObjectValue(V8\Value)->IsBoolean(): bool(false) -V8\ObjectValue(V8\Value)->IsNumber(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32(): bool(false) -V8\ObjectValue(V8\Value)->IsDate(): bool(false) -V8\ObjectValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\ObjectValue(V8\Value)->IsBooleanObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNumberObject(): bool(false) -V8\ObjectValue(V8\Value)->IsStringObject(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbolObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNativeError(): bool(true) -V8\ObjectValue(V8\Value)->IsRegExp(): bool(false) -V8\ObjectValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\ObjectValue(V8\Value)->IsPromise(): bool(false) -V8\ObjectValue(V8\Value)->IsMap(): bool(false) -V8\ObjectValue(V8\Value)->IsSet(): bool(false) -V8\ObjectValue(V8\Value)->IsMapIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsSetIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakMap(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakSet(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\ObjectValue(V8\Value)->IsTypedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsInt8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat64Array(): bool(false) -V8\ObjectValue(V8\Value)->IsDataView(): bool(false) -V8\ObjectValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsProxy(): bool(false) diff --git a/tests/V8Isolate_gc_cyclic_ref_memleak.phpt b/tests/V8Isolate_gc_cyclic_ref_memleak.phpt index 96a4e85..7ef9621 100644 --- a/tests/V8Isolate_gc_cyclic_ref_memleak.phpt +++ b/tests/V8Isolate_gc_cyclic_ref_memleak.phpt @@ -17,7 +17,7 @@ $isolate = new \V8\Isolate(); $global_template = new V8\ObjectTemplate($isolate); $func_tpl = new \V8\FunctionTemplate($isolate, function () {}); -$global_template->Set(new \V8\StringValue($isolate, 'func'), $func_tpl, \V8\PropertyAttribute::DontDelete); +$global_template->set(new \V8\StringValue($isolate, 'func'), $func_tpl, \V8\PropertyAttribute::DontDelete); $foo = new V8\ObjectTemplate($isolate);; $name = new V8\StringValue($isolate, 'test'); @@ -32,16 +32,16 @@ $handlers = new \V8\IndexedPropertyHandlerConfiguration($getter); $getter = null; $test_obj_tpl = new \V8\ObjectTemplate($isolate); -$test_obj_tpl->SetHandlerForIndexedProperty($handlers); +$test_obj_tpl->setHandlerForIndexedProperty($handlers); -$global_template->Set(new \V8\StringValue($isolate, 'test'), $test_obj_tpl); +$global_template->set(new \V8\StringValue($isolate, 'test'), $test_obj_tpl); $handlers = null; $context = new \V8\Context($isolate, $global_template); $obj = new V8\ObjectValue($context); -$obj->SetAccessor($context, new \V8\StringValue($isolate, 'test'), function () use (&$isolate, &$foo, &$name) {}); +$obj->setAccessor($context, new \V8\StringValue($isolate, 'test'), function () use (&$isolate, &$foo, &$name) {}); echo 'Done here for now', PHP_EOL; ?> diff --git a/tests/V8Isolate_GetEnteredContext.phpt b/tests/V8Isolate_getEnteredContext.phpt similarity index 74% rename from tests/V8Isolate_GetEnteredContext.phpt rename to tests/V8Isolate_getEnteredContext.phpt index 9cc21e3..a06cb94 100644 --- a/tests/V8Isolate_GetEnteredContext.phpt +++ b/tests/V8Isolate_getEnteredContext.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\Isolate::GetEnteredContext() +V8\Isolate::getEnteredContext() --SKIPIF-- --FILE-- @@ -14,7 +14,7 @@ $v8_helper = new PhpV8Helpers($helper); $isolate = new \V8\Isolate(); try { - $isolate->GetEnteredContext(); + $isolate->getEnteredContext(); }catch (\V8\Exceptions\Exception $e) { $helper->exception_export($e); } @@ -23,12 +23,12 @@ try { $helper->line(); $func_tpl = new \V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use ($helper) { - $helper->assert('Isolate has entered context', $info->GetIsolate()->GetEnteredContext() === $info->GetContext()); + $helper->assert('Isolate has entered context', $info->getIsolate()->getEnteredContext() === $info->getContext()); }); $global_tpl = new \V8\ObjectTemplate($isolate); -$global_tpl->Set(new \V8\StringValue($isolate, 'test'), $func_tpl); +$global_tpl->set(new \V8\StringValue($isolate, 'test'), $func_tpl); $context = new \V8\Context($isolate, $global_tpl); diff --git a/tests/V8Isolate_IsDead.phpt b/tests/V8Isolate_isDead.phpt similarity index 73% rename from tests/V8Isolate_IsDead.phpt rename to tests/V8Isolate_isDead.phpt index 8bc07c1..a2ccb2d 100644 --- a/tests/V8Isolate_IsDead.phpt +++ b/tests/V8Isolate_isDead.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\Isolate::IsDead() +V8\Isolate::isDead() --SKIPIF-- --FILE-- @@ -13,9 +13,9 @@ $v8_helper = new PhpV8Helpers($helper); $isolate = new V8\Isolate(); -$helper->method_export($isolate, 'IsDead'); +$helper->method_export($isolate, 'isDead'); ?> --EXPECT-- -V8\Isolate->IsDead(): bool(false) +V8\Isolate->isDead(): bool(false) diff --git a/tests/V8Isolate_IsInUse.phpt b/tests/V8Isolate_isInUse.phpt similarity index 70% rename from tests/V8Isolate_IsInUse.phpt rename to tests/V8Isolate_isInUse.phpt index fc550c8..e093203 100644 --- a/tests/V8Isolate_IsInUse.phpt +++ b/tests/V8Isolate_isInUse.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\Isolate::IsInUse() +V8\Isolate::isInUse() --SKIPIF-- --FILE-- @@ -14,17 +14,17 @@ $v8_helper = new PhpV8Helpers($helper); $isolate = new V8\Isolate(); -$helper->inline_dump('Isolate in use', $isolate->IsInUse()); +$helper->inline_dump('Isolate in use', $isolate->isInUse()); $context = new V8\Context($isolate); $fnc = new \V8\FunctionObject($context, function (\V8\CallbackInfo $info) use ($helper) { - $helper->inline_dump('Isolate in use', $info->GetIsolate()->IsInUse()); + $helper->inline_dump('Isolate in use', $info->getIsolate()->isInUse()); }); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test'), $fnc); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test'), $fnc); -(new \V8\Script($context, new \V8\StringValue($isolate, 'test()')))->Run($context); +(new \V8\Script($context, new \V8\StringValue($isolate, 'test()')))->run($context); ?> --EXPECT-- diff --git a/tests/V8Isolate_limit_memory.phpt b/tests/V8Isolate_limit_memory.phpt index a0b83d2..956fa75 100644 --- a/tests/V8Isolate_limit_memory.phpt +++ b/tests/V8Isolate_limit_memory.phpt @@ -38,28 +38,28 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); $memory_limit = 1024 * 1024 * 10; -$helper->assert('Memory limit accessor report no hit', false === $isolate->IsMemoryLimitHit()); -$helper->assert('Get memory limit default value is zero', 0 === $isolate->GetMemoryLimit()); -$isolate->SetMemoryLimit($memory_limit); -$helper->assert('Get memory limit returns valid value', $memory_limit === $isolate->GetMemoryLimit()); +$helper->assert('Memory limit accessor report no hit', false === $isolate->isMemoryLimitHit()); +$helper->assert('Get memory limit default value is zero', 0 === $isolate->getMemoryLimit()); +$isolate->setMemoryLimit($memory_limit); +$helper->assert('Get memory limit returns valid value', $memory_limit === $isolate->getMemoryLimit()); $helper->dump($isolate); $helper->line(); try { - $res = $script->Run($context); + $res = $script->run($context); } catch(\V8\Exceptions\MemoryLimitException $e) { $helper->exception_export($e); echo 'script execution terminated', PHP_EOL; } -$helper->assert('Get memory limit returns valid value', $memory_limit === $isolate->GetMemoryLimit()); -$helper->assert('Memory limit accessor report hit', true === $isolate->IsMemoryLimitHit()); +$helper->assert('Get memory limit returns valid value', $memory_limit === $isolate->getMemoryLimit()); +$helper->assert('Memory limit accessor report hit', true === $isolate->isMemoryLimitHit()); $helper->line(); $helper->dump($isolate); -$helper->dump($isolate->GetHeapStatistics()); +$helper->dump($isolate->getHeapStatistics()); // EXPECTF: ---/float\(.+\)/ // EXPECTF: +++float(%f) diff --git a/tests/V8Isolate_limit_memory_nested.phpt b/tests/V8Isolate_limit_memory_nested.phpt index 1190b6c..95d9a5e 100644 --- a/tests/V8Isolate_limit_memory_nested.phpt +++ b/tests/V8Isolate_limit_memory_nested.phpt @@ -28,8 +28,8 @@ $context = new V8\Context($isolate); $v8_helper->injectConsoleLog($context); $func = new V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $info) use (&$helper) { - if (!$info->Arguments()) { - $isolate = $info->GetIsolate(); + if (!$info->arguments()) { + $isolate = $info->getIsolate(); $source = ' var str = " ".repeat(1024); // 1kb @@ -40,10 +40,10 @@ $func = new V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $info } '; - $script = new V8\Script($info->GetContext(), new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin('wait_for_termination.js')); + $script = new V8\Script($info->getContext(), new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin('wait_for_termination.js')); try { - $script->Run($info->GetContext()); + $script->run($info->getContext()); } catch (\V8\Exceptions\MemoryLimitException $e) { $helper->exception_export($e); echo 'wait loop terminated', PHP_EOL; @@ -53,10 +53,10 @@ $func = new V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $info return; } - $fnc= $info->Arguments()[0]; + $fnc= $info->arguments()[0]; try { - $fnc->Call($info->GetContext(), $fnc); + $fnc->call($info->getContext(), $fnc); } catch (\V8\Exceptions\MemoryLimitException $e) { $helper->exception_export($e); echo 'function call terminated', PHP_EOL; @@ -65,10 +65,10 @@ $func = new V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $info }); -$func->SetName(new \V8\StringValue($isolate, 'custom_name')); +$func->setName(new \V8\StringValue($isolate, 'custom_name')); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test'), $func); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test'), $func); $source = 'test(test); delete print; "Script done"'; $file_name = 'test.js'; @@ -76,13 +76,13 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$isolate->SetMemoryLimit(1024 * 1024 * 10); +$isolate->setMemoryLimit(1024 * 1024 * 10); $helper->dump($isolate); $helper->line(); $t = microtime(true); try { - $script->Run($context); + $script->run($context); } catch(\V8\Exceptions\MemoryLimitException $e) { $helper->exception_export($e); echo 'script execution terminated', PHP_EOL; diff --git a/tests/V8Isolate_limit_memory_not_hit.phpt b/tests/V8Isolate_limit_memory_not_hit.phpt index ee3fd37..7821a20 100644 --- a/tests/V8Isolate_limit_memory_not_hit.phpt +++ b/tests/V8Isolate_limit_memory_not_hit.phpt @@ -25,17 +25,17 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); $memory_limit = 1024 * 1024 * 10; -$helper->assert('Memory limit accessor report no hit', false === $isolate->IsMemoryLimitHit()); -$helper->assert('Get memory limit default value is zero', 0 === $isolate->GetMemoryLimit()); -$isolate->SetMemoryLimit($memory_limit); -$helper->assert('Get memory limit returns valid value', $memory_limit === $isolate->GetMemoryLimit()); +$helper->assert('Memory limit accessor report no hit', false === $isolate->isMemoryLimitHit()); +$helper->assert('Get memory limit default value is zero', 0 === $isolate->getMemoryLimit()); +$isolate->setMemoryLimit($memory_limit); +$helper->assert('Get memory limit returns valid value', $memory_limit === $isolate->getMemoryLimit()); $helper->dump($isolate); $helper->line(); $t = microtime(true); try { - $script->Run($context); + $script->run($context); } finally { $helper->line(); $t = microtime(true) - $t; @@ -43,8 +43,8 @@ try { $helper->assert('Script execution time is less than 0.5 sec', $t < 0.5); } -$helper->assert('Get memory limit returns valid value', $memory_limit === $isolate->GetMemoryLimit()); -$helper->assert('Memory limit accessor report not hit', false === $isolate->IsMemoryLimitHit()); +$helper->assert('Get memory limit returns valid value', $memory_limit === $isolate->getMemoryLimit()); +$helper->assert('Memory limit accessor report not hit', false === $isolate->isMemoryLimitHit()); $helper->line(); $helper->dump($isolate); diff --git a/tests/V8Isolate_limit_time.phpt b/tests/V8Isolate_limit_time.phpt index 83560db..e4ce3d1 100644 --- a/tests/V8Isolate_limit_time.phpt +++ b/tests/V8Isolate_limit_time.phpt @@ -36,17 +36,17 @@ if ($helper->need_more_time()) { $high_range = 1.65; } -$helper->assert('Time limit accessor report no hit', false === $isolate->IsTimeLimitHit()); -$helper->assert('Get time limit default value is zero', 0.0 === $isolate->GetTimeLimit()); -$isolate->SetTimeLimit($time_limit); -$helper->assert('Get time limit returns valid value', $time_limit === $isolate->GetTimeLimit()); +$helper->assert('Time limit accessor report no hit', false === $isolate->isTimeLimitHit()); +$helper->assert('Get time limit default value is zero', 0.0 === $isolate->getTimeLimit()); +$isolate->setTimeLimit($time_limit); +$helper->assert('Get time limit returns valid value', $time_limit === $isolate->getTimeLimit()); $helper->dump($isolate); $helper->line(); $t = microtime(true); try { - $res = $script->Run($context); + $res = $script->run($context); } catch(\V8\Exceptions\TimeLimitException $e) { $helper->exception_export($e); echo 'script execution terminated', PHP_EOL; @@ -57,8 +57,8 @@ try { $helper->assert("Script execution time is within specified range ({$low_range}, {$high_range})", $t >= $low_range && $t < $high_range); } -$helper->assert('Get time limit returns valid value', $time_limit === $isolate->GetTimeLimit()); -$helper->assert('Time limit accessor report hit', true === $isolate->IsTimeLimitHit()); +$helper->assert('Get time limit returns valid value', $time_limit === $isolate->getTimeLimit()); +$helper->assert('Time limit accessor report hit', true === $isolate->isTimeLimitHit()); $helper->line(); $helper->dump($isolate); diff --git a/tests/V8Isolate_limit_time_affects_js_runtime_only.phpt b/tests/V8Isolate_limit_time_affects_js_runtime_only.phpt index 899841f..2db1aef 100644 --- a/tests/V8Isolate_limit_time_affects_js_runtime_only.phpt +++ b/tests/V8Isolate_limit_time_affects_js_runtime_only.phpt @@ -36,10 +36,10 @@ if ($helper->need_more_time()) { $high_range = 1.65; } -$helper->assert('Time limit accessor report no hit', false === $isolate->IsTimeLimitHit()); -$helper->assert('Get time limit default value is zero', 0.0 === $isolate->GetTimeLimit()); -$isolate->SetTimeLimit($time_limit); -$helper->assert('Get time limit returns valid value', $time_limit === $isolate->GetTimeLimit()); +$helper->assert('Time limit accessor report no hit', false === $isolate->isTimeLimitHit()); +$helper->assert('Get time limit default value is zero', 0.0 === $isolate->getTimeLimit()); +$isolate->setTimeLimit($time_limit); +$helper->assert('Get time limit returns valid value', $time_limit === $isolate->getTimeLimit()); $helper->dump($isolate); $helper->line(); @@ -49,7 +49,7 @@ sleep($time_limit); $t = microtime(true); try { - $res = $script->Run($context); + $res = $script->run($context); } catch(\V8\Exceptions\TimeLimitException $e) { $helper->exception_export($e); echo 'script execution terminated', PHP_EOL; @@ -60,8 +60,8 @@ try { $helper->assert("Script execution time is within specified range ({$low_range}, {$high_range})", $t >= $low_range && $t < $high_range); } -$helper->assert('Get time limit returns valid value', $time_limit === $isolate->GetTimeLimit()); -$helper->assert('Time limit accessor report hit', true === $isolate->IsTimeLimitHit()); +$helper->assert('Get time limit returns valid value', $time_limit === $isolate->getTimeLimit()); +$helper->assert('Time limit accessor report hit', true === $isolate->isTimeLimitHit()); $helper->line(); $helper->dump($isolate); diff --git a/tests/V8Isolate_limit_time_changed_at_runtime.phpt b/tests/V8Isolate_limit_time_changed_at_runtime.phpt index b617740..d62c33b 100644 --- a/tests/V8Isolate_limit_time_changed_at_runtime.phpt +++ b/tests/V8Isolate_limit_time_changed_at_runtime.phpt @@ -38,29 +38,29 @@ if (!$helper->need_more_time() && $helper->is_memory_test()) { $func = new V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $args) use ($helper) { $t = microtime(true); - $isolate = $args->GetIsolate(); + $isolate = $args->getIsolate(); - $sleep_1 = $isolate->GetTimeLimit() + $isolate->GetTimeLimit()/10; // +10% to make 100% sure we hit time limit - $sleep_2 = $isolate->GetTimeLimit() + $isolate->GetTimeLimit()/10; + $sleep_1 = $isolate->getTimeLimit() + $isolate->getTimeLimit()/10; // +10% to make 100% sure we hit time limit + $sleep_2 = $isolate->getTimeLimit() + $isolate->getTimeLimit()/10; - $helper->assert('Time limit is not hit', !$isolate->IsTimeLimitHit()); + $helper->assert('Time limit is not hit', !$isolate->isTimeLimitHit()); echo 'sleep ', $sleep_1, 'sec', PHP_EOL; usleep($sleep_1*1000000); - $helper->assert('Time limit is hit', $isolate->IsTimeLimitHit()); + $helper->assert('Time limit is hit', $isolate->isTimeLimitHit()); - $args->GetIsolate()->SetTimeLimit($isolate->GetTimeLimit()); // Setting timeout will reset any previous timeout + $args->getIsolate()->setTimeLimit($isolate->getTimeLimit()); // Setting timeout will reset any previous timeout - $helper->assert('Setting time limit from php resets time limit hit', !$isolate->IsTimeLimitHit()); + $helper->assert('Setting time limit from php resets time limit hit', !$isolate->isTimeLimitHit()); echo 'sleep ', $sleep_2, 'sec', PHP_EOL; usleep($sleep_2*1000000); - $helper->assert('However, it is hit once again', $isolate->IsTimeLimitHit()); + $helper->assert('However, it is hit once again', $isolate->isTimeLimitHit()); echo 'total in function: ', microtime(true) - $t, 'sec', PHP_EOL; }); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'sleep'), $func); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'sleep'), $func); -$isolate->SetTimeLimit($time_limit); +$isolate->setTimeLimit($time_limit); $t = microtime(true); try { diff --git a/tests/V8Isolate_limit_time_nested.phpt b/tests/V8Isolate_limit_time_nested.phpt index c7ae994..d19d7fb 100644 --- a/tests/V8Isolate_limit_time_nested.phpt +++ b/tests/V8Isolate_limit_time_nested.phpt @@ -17,13 +17,13 @@ $global_template = new V8\ObjectTemplate($isolate); $context = new V8\Context($isolate, $global_template); $func = new V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $info) use (&$helper) { - if (!$info->Arguments()) { - $isolate = $info->GetIsolate(); + if (!$info->arguments()) { + $isolate = $info->getIsolate(); - $script = new V8\Script($info->GetContext(), new \V8\StringValue($isolate, 'for(;;);'), new \V8\ScriptOrigin('wait_for_termination.js')); + $script = new V8\Script($info->getContext(), new \V8\StringValue($isolate, 'for(;;);'), new \V8\ScriptOrigin('wait_for_termination.js')); try { - $script->Run($info->GetContext()); + $script->run($info->getContext()); } catch (\V8\Exceptions\TimeLimitException $e) { $helper->exception_export($e); echo 'wait loop terminated', PHP_EOL; @@ -33,10 +33,10 @@ $func = new V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $info return; } - $fnc= $info->Arguments()[0]; + $fnc= $info->arguments()[0]; try { - $fnc->Call($info->GetContext(), $fnc); + $fnc->call($info->getContext(), $fnc); } catch (\V8\Exceptions\TimeLimitException $e) { $helper->exception_export($e); echo 'function call terminated', PHP_EOL; @@ -45,10 +45,10 @@ $func = new V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $info }); -$func->SetName(new \V8\StringValue($isolate, 'custom_name')); +$func->setName(new \V8\StringValue($isolate, 'custom_name')); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test'), $func); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test'), $func); $source = 'test(test); delete print; "Script done"'; $file_name = 'test.js'; @@ -67,13 +67,13 @@ if ($helper->need_more_time()) { $high_range = 1.65; } -$isolate->SetTimeLimit($time_limit); +$isolate->setTimeLimit($time_limit); $helper->dump($isolate); $helper->line(); $t = microtime(true); try { - $script->Run($context); + $script->run($context); } catch(\V8\Exceptions\TimeLimitException $e) { $helper->exception_export($e); echo 'script execution terminated', PHP_EOL; diff --git a/tests/V8Isolate_limit_time_not_hit.phpt b/tests/V8Isolate_limit_time_not_hit.phpt index f120bdb..15afa5d 100644 --- a/tests/V8Isolate_limit_time_not_hit.phpt +++ b/tests/V8Isolate_limit_time_not_hit.phpt @@ -25,17 +25,17 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); $time_limit = 1.5; -$helper->assert('Time limit accessor report no hit', false === $isolate->IsTimeLimitHit()); -$helper->assert('Get time limit default value is zero', 0.0 === $isolate->GetTimeLimit()); -$isolate->SetTimeLimit($time_limit); -$helper->assert('Get time limit returns valid value', $time_limit === $isolate->GetTimeLimit()); +$helper->assert('Time limit accessor report no hit', false === $isolate->isTimeLimitHit()); +$helper->assert('Get time limit default value is zero', 0.0 === $isolate->getTimeLimit()); +$isolate->setTimeLimit($time_limit); +$helper->assert('Get time limit returns valid value', $time_limit === $isolate->getTimeLimit()); $helper->dump($isolate); $helper->line(); $t = microtime(true); try { - $script->Run($context); + $script->run($context); } finally { $helper->line(); $t = microtime(true) - $t; @@ -43,8 +43,8 @@ try { $helper->assert('Script execution time is less than 0.5 sec', $t < 0.5); } -$helper->assert('Get time limit returns valid value', $time_limit === $isolate->GetTimeLimit()); -$helper->assert('Time limit accessor report not hit', false === $isolate->IsTimeLimitHit()); +$helper->assert('Get time limit returns valid value', $time_limit === $isolate->getTimeLimit()); +$helper->assert('Time limit accessor report not hit', false === $isolate->isTimeLimitHit()); $helper->line(); $helper->dump($isolate); diff --git a/tests/V8Isolate_limit_time_set_during_execution.phpt b/tests/V8Isolate_limit_time_set_during_execution.phpt index b2fe6b3..3dded34 100644 --- a/tests/V8Isolate_limit_time_set_during_execution.phpt +++ b/tests/V8Isolate_limit_time_set_during_execution.phpt @@ -27,12 +27,12 @@ if ($helper->need_more_time()) { } $func = new V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $info) use (&$helper, $time_limit) { - $isolate = $info->GetIsolate(); - $isolate->SetTimeLimit($time_limit); + $isolate = $info->getIsolate(); + $isolate->setTimeLimit($time_limit); }); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test'), $func); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test'), $func); $source = ' test(); @@ -47,7 +47,7 @@ $helper->line(); $t = microtime(true); try { - $script->Run($context); + $script->run($context); } catch(\V8\Exceptions\TimeLimitException $e) { $helper->exception_export($e); echo 'script execution terminated', PHP_EOL; diff --git a/tests/V8Isolate_nested_termination_exceptions.phpt b/tests/V8Isolate_nested_termination_exceptions.phpt index f08d4f4..596816c 100644 --- a/tests/V8Isolate_nested_termination_exceptions.phpt +++ b/tests/V8Isolate_nested_termination_exceptions.phpt @@ -16,14 +16,14 @@ $global_template = new V8\ObjectTemplate($isolate); $context = new V8\Context($isolate, $global_template); $func = new V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $info) { - if (!$info->Arguments()) { - $isolate = $info->GetIsolate(); + if (!$info->arguments()) { + $isolate = $info->getIsolate(); - $script = new V8\Script($info->GetContext(), new \V8\StringValue($isolate, 'for(;;);'), new \V8\ScriptOrigin('wait_for_termination.js')); - $isolate->TerminateExecution(); + $script = new V8\Script($info->getContext(), new \V8\StringValue($isolate, 'for(;;);'), new \V8\ScriptOrigin('wait_for_termination.js')); + $isolate->terminateExecution(); try { - $script->Run($info->GetContext()); + $script->run($info->getContext()); } catch (\V8\Exceptions\TerminationException $e) { echo 'wait loop terminated', PHP_EOL; } @@ -31,20 +31,20 @@ $func = new V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $info return; } - $fnc= $info->Arguments()[0]; + $fnc= $info->arguments()[0]; try { - $fnc->Call($info->GetContext(), $fnc); + $fnc->call($info->getContext(), $fnc); } catch (\V8\Exceptions\TerminationException $e) { echo 'function call terminated', PHP_EOL; } }); -$func->SetName(new \V8\StringValue($isolate, 'custom_name')); +$func->setName(new \V8\StringValue($isolate, 'custom_name')); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test'), $func); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test'), $func); $source = 'test(test); delete print; "Script done"'; $file_name = 'test.js'; @@ -53,7 +53,7 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); try { - $script->Run($context); + $script->run($context); } catch (\V8\Exceptions\TerminationException $e) { echo 'script execution terminated', PHP_EOL; } diff --git a/tests/V8Isolate_snapshot_support.phpt b/tests/V8Isolate_snapshot_support.phpt index d451ec0..9f4eaa3 100644 --- a/tests/V8Isolate_snapshot_support.phpt +++ b/tests/V8Isolate_snapshot_support.phpt @@ -19,7 +19,7 @@ $helper->space(); $context = new \V8\Context($isolate); -$helper->assert('Context should have no test data', $context->GlobalObject()->Has($context, new \V8\StringValue($isolate, 'test_snapshot')), false); +$helper->assert('Context should have no test data', $context->globalObject()->has($context, new \V8\StringValue($isolate, 'test_snapshot')), false); $helper->line(); @@ -32,7 +32,7 @@ $helper->space(); $source = 'function test_snapshot() { return "hello, world";}'; -$data = V8\StartupData::CreateFromSource($source); +$data = V8\StartupData::createFromSource($source); $isolate = new \v8Tests\TrackingDtors\Isolate($data); @@ -44,21 +44,21 @@ $helper->space(); $context = new \V8\Context($isolate); -$helper->assert('Context should have test function', $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'test_snapshot'))->IsFunction()); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test_snapshot'), new \V8\StringValue($isolate, 'garbage')); +$helper->assert('Context should have test function', $context->globalObject()->get($context, new \V8\StringValue($isolate, 'test_snapshot'))->isFunction()); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test_snapshot'), new \V8\StringValue($isolate, 'garbage')); $context = new \V8\Context($isolate); -$helper->assert('Contexts from the same snapshot doesn\'t affected by each other', $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'test_snapshot'))->IsFunction()); +$helper->assert('Contexts from the same snapshot doesn\'t affected by each other', $context->globalObject()->get($context, new \V8\StringValue($isolate, 'test_snapshot'))->isFunction()); $isolate2 = new \v8Tests\TrackingDtors\Isolate($data); $context2 = new \V8\Context($isolate2); -$helper->assert('Contexts between different isolates from the same snapshot doesn\'t affected by each other', $context2->GlobalObject()->Get($context2, new \V8\StringValue($isolate2, 'test_snapshot'))->IsFunction()); +$helper->assert('Contexts between different isolates from the same snapshot doesn\'t affected by each other', $context2->globalObject()->get($context2, new \V8\StringValue($isolate2, 'test_snapshot'))->isFunction()); $isolate3 = new \v8Tests\TrackingDtors\Isolate($data); $data = null; $context3 = new \V8\Context($isolate3); -$helper->assert('Deleting reference to snapshot is OK after creating Isolate instance', $context3->GlobalObject()->Get($context3, new \V8\StringValue($isolate3, 'test_snapshot'))->IsFunction()); +$helper->assert('Deleting reference to snapshot is OK after creating Isolate instance', $context3->globalObject()->get($context3, new \V8\StringValue($isolate3, 'test_snapshot'))->isFunction()); $helper->line(); $context = null; diff --git a/tests/V8Isolate_throwException.phpt b/tests/V8Isolate_throwException.phpt new file mode 100644 index 0000000..a43d862 --- /dev/null +++ b/tests/V8Isolate_throwException.phpt @@ -0,0 +1,278 @@ +--TEST-- +V8\Isolate::throwException() +--SKIPIF-- + +--FILE-- +arguments()) ? $info->arguments()[0] : new \V8\StringValue($info->getIsolate(), "exception"); + + $info->getIsolate()->throwException($info->getContext(), $value); +}); + + +$global_tpl = new \V8\ObjectTemplate($isolate); +$global_tpl->set(new \V8\StringValue($isolate, 'e'), $func_tpl); + +$context = new \V8\Context($isolate, $global_tpl); +$v8_helper->injectConsoleLog($context); + + +$v8_helper->CompileTryRun($context, 'e()'); +$v8_helper->CompileTryRun($context, 'e("test")'); + + +$source = ' + var ex; + + try { + e("foo"); + } catch (exception) { + console.log("exception: ", "\'", exception, "\'"); + console.log("exception.stack: ", exception.stack); + ex = exception; + } + + ex +'; + +$helper->line(); + +$res = $v8_helper->CompileRun($context, $source); +$helper->line(); +$v8_helper->CHECK($res->strictEquals(new \V8\StringValue($isolate, 'foo')), '$res->strictEquals(new \V8\StringValue($isolate, \'foo\'))'); +$helper->line(); + +$v8_helper->run_checks($res); + + +$source = ' + var ex; + + try { + e({}); + } catch (exception) { + console.log("exception: ", "\'", exception, "\'"); + console.log("exception.stack: ", exception.stack); + ex = exception; + } + + ex +'; + +$res = $v8_helper->CompileRun($context, $source); +$helper->line(); + +$v8_helper->run_checks($res); + +$source = ' + var ex; + + try { + throw new Error(); + } catch (exception) { + console.log("exception: ", "\'", exception, "\'"); + console.log("exception.stack: ", exception.stack); + ex = exception; + } + + ex +'; + +$res = $v8_helper->CompileRun($context, $source); +$helper->line(); + +$v8_helper->run_checks($res); + + +?> +--EXPECT-- +e(): V8\Exceptions\TryCatchException: exception +e("test"): V8\Exceptions\TryCatchException: test + +exception: 'foo' +exception.stack: + +CHECK $res->strictEquals(new \V8\StringValue($isolate, 'foo')): OK + +Checks on V8\StringValue: +------------------------- +V8\StringValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "string" + +V8\StringValue->isOneByte(): bool(true) +V8\StringValue(V8\Value)->isUndefined(): bool(false) +V8\StringValue(V8\Value)->isNull(): bool(false) +V8\StringValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\StringValue(V8\Value)->isTrue(): bool(false) +V8\StringValue(V8\Value)->isFalse(): bool(false) +V8\StringValue(V8\Value)->isName(): bool(true) +V8\StringValue(V8\Value)->isString(): bool(true) +V8\StringValue(V8\Value)->isSymbol(): bool(false) +V8\StringValue(V8\Value)->isFunction(): bool(false) +V8\StringValue(V8\Value)->isArray(): bool(false) +V8\StringValue(V8\Value)->isObject(): bool(false) +V8\StringValue(V8\Value)->isBoolean(): bool(false) +V8\StringValue(V8\Value)->isNumber(): bool(false) +V8\StringValue(V8\Value)->isInt32(): bool(false) +V8\StringValue(V8\Value)->isUint32(): bool(false) +V8\StringValue(V8\Value)->isDate(): bool(false) +V8\StringValue(V8\Value)->isArgumentsObject(): bool(false) +V8\StringValue(V8\Value)->isBooleanObject(): bool(false) +V8\StringValue(V8\Value)->isNumberObject(): bool(false) +V8\StringValue(V8\Value)->isStringObject(): bool(false) +V8\StringValue(V8\Value)->isSymbolObject(): bool(false) +V8\StringValue(V8\Value)->isNativeError(): bool(false) +V8\StringValue(V8\Value)->isRegExp(): bool(false) +V8\StringValue(V8\Value)->isAsyncFunction(): bool(false) +V8\StringValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\StringValue(V8\Value)->isGeneratorObject(): bool(false) +V8\StringValue(V8\Value)->isPromise(): bool(false) +V8\StringValue(V8\Value)->isMap(): bool(false) +V8\StringValue(V8\Value)->isSet(): bool(false) +V8\StringValue(V8\Value)->isMapIterator(): bool(false) +V8\StringValue(V8\Value)->isSetIterator(): bool(false) +V8\StringValue(V8\Value)->isWeakMap(): bool(false) +V8\StringValue(V8\Value)->isWeakSet(): bool(false) +V8\StringValue(V8\Value)->isArrayBuffer(): bool(false) +V8\StringValue(V8\Value)->isArrayBufferView(): bool(false) +V8\StringValue(V8\Value)->isTypedArray(): bool(false) +V8\StringValue(V8\Value)->isUint8Array(): bool(false) +V8\StringValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\StringValue(V8\Value)->isInt8Array(): bool(false) +V8\StringValue(V8\Value)->isUint16Array(): bool(false) +V8\StringValue(V8\Value)->isInt16Array(): bool(false) +V8\StringValue(V8\Value)->isUint32Array(): bool(false) +V8\StringValue(V8\Value)->isInt32Array(): bool(false) +V8\StringValue(V8\Value)->isFloat32Array(): bool(false) +V8\StringValue(V8\Value)->isFloat64Array(): bool(false) +V8\StringValue(V8\Value)->isDataView(): bool(false) +V8\StringValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\StringValue(V8\Value)->isProxy(): bool(false) + + +exception: '[object Object]' +exception.stack: + +Checks on V8\ObjectValue: +------------------------- +V8\ObjectValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\ObjectValue->isCallable(): bool(false) +V8\ObjectValue->isConstructor(): bool(false) +V8\ObjectValue(V8\Value)->isUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isNull(): bool(false) +V8\ObjectValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isTrue(): bool(false) +V8\ObjectValue(V8\Value)->isFalse(): bool(false) +V8\ObjectValue(V8\Value)->isName(): bool(false) +V8\ObjectValue(V8\Value)->isString(): bool(false) +V8\ObjectValue(V8\Value)->isSymbol(): bool(false) +V8\ObjectValue(V8\Value)->isFunction(): bool(false) +V8\ObjectValue(V8\Value)->isArray(): bool(false) +V8\ObjectValue(V8\Value)->isObject(): bool(true) +V8\ObjectValue(V8\Value)->isBoolean(): bool(false) +V8\ObjectValue(V8\Value)->isNumber(): bool(false) +V8\ObjectValue(V8\Value)->isInt32(): bool(false) +V8\ObjectValue(V8\Value)->isUint32(): bool(false) +V8\ObjectValue(V8\Value)->isDate(): bool(false) +V8\ObjectValue(V8\Value)->isArgumentsObject(): bool(false) +V8\ObjectValue(V8\Value)->isBooleanObject(): bool(false) +V8\ObjectValue(V8\Value)->isNumberObject(): bool(false) +V8\ObjectValue(V8\Value)->isStringObject(): bool(false) +V8\ObjectValue(V8\Value)->isSymbolObject(): bool(false) +V8\ObjectValue(V8\Value)->isNativeError(): bool(false) +V8\ObjectValue(V8\Value)->isRegExp(): bool(false) +V8\ObjectValue(V8\Value)->isAsyncFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorObject(): bool(false) +V8\ObjectValue(V8\Value)->isPromise(): bool(false) +V8\ObjectValue(V8\Value)->isMap(): bool(false) +V8\ObjectValue(V8\Value)->isSet(): bool(false) +V8\ObjectValue(V8\Value)->isMapIterator(): bool(false) +V8\ObjectValue(V8\Value)->isSetIterator(): bool(false) +V8\ObjectValue(V8\Value)->isWeakMap(): bool(false) +V8\ObjectValue(V8\Value)->isWeakSet(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBufferView(): bool(false) +V8\ObjectValue(V8\Value)->isTypedArray(): bool(false) +V8\ObjectValue(V8\Value)->isUint8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\ObjectValue(V8\Value)->isInt8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint16Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt16Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint32Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat64Array(): bool(false) +V8\ObjectValue(V8\Value)->isDataView(): bool(false) +V8\ObjectValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isProxy(): bool(false) + + +exception: 'Error' +exception.stack: Error + at test.js:5:15 + +Checks on V8\ObjectValue: +------------------------- +V8\ObjectValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\ObjectValue->isCallable(): bool(false) +V8\ObjectValue->isConstructor(): bool(false) +V8\ObjectValue(V8\Value)->isUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isNull(): bool(false) +V8\ObjectValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isTrue(): bool(false) +V8\ObjectValue(V8\Value)->isFalse(): bool(false) +V8\ObjectValue(V8\Value)->isName(): bool(false) +V8\ObjectValue(V8\Value)->isString(): bool(false) +V8\ObjectValue(V8\Value)->isSymbol(): bool(false) +V8\ObjectValue(V8\Value)->isFunction(): bool(false) +V8\ObjectValue(V8\Value)->isArray(): bool(false) +V8\ObjectValue(V8\Value)->isObject(): bool(true) +V8\ObjectValue(V8\Value)->isBoolean(): bool(false) +V8\ObjectValue(V8\Value)->isNumber(): bool(false) +V8\ObjectValue(V8\Value)->isInt32(): bool(false) +V8\ObjectValue(V8\Value)->isUint32(): bool(false) +V8\ObjectValue(V8\Value)->isDate(): bool(false) +V8\ObjectValue(V8\Value)->isArgumentsObject(): bool(false) +V8\ObjectValue(V8\Value)->isBooleanObject(): bool(false) +V8\ObjectValue(V8\Value)->isNumberObject(): bool(false) +V8\ObjectValue(V8\Value)->isStringObject(): bool(false) +V8\ObjectValue(V8\Value)->isSymbolObject(): bool(false) +V8\ObjectValue(V8\Value)->isNativeError(): bool(true) +V8\ObjectValue(V8\Value)->isRegExp(): bool(false) +V8\ObjectValue(V8\Value)->isAsyncFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorObject(): bool(false) +V8\ObjectValue(V8\Value)->isPromise(): bool(false) +V8\ObjectValue(V8\Value)->isMap(): bool(false) +V8\ObjectValue(V8\Value)->isSet(): bool(false) +V8\ObjectValue(V8\Value)->isMapIterator(): bool(false) +V8\ObjectValue(V8\Value)->isSetIterator(): bool(false) +V8\ObjectValue(V8\Value)->isWeakMap(): bool(false) +V8\ObjectValue(V8\Value)->isWeakSet(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBufferView(): bool(false) +V8\ObjectValue(V8\Value)->isTypedArray(): bool(false) +V8\ObjectValue(V8\Value)->isUint8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\ObjectValue(V8\Value)->isInt8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint16Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt16Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint32Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat64Array(): bool(false) +V8\ObjectValue(V8\Value)->isDataView(): bool(false) +V8\ObjectValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isProxy(): bool(false) diff --git a/tests/V8Isolate_ThrowException_with_external.phpt b/tests/V8Isolate_throwException_with_external.phpt similarity index 71% rename from tests/V8Isolate_ThrowException_with_external.phpt rename to tests/V8Isolate_throwException_with_external.phpt index e30c99e..3f19355 100644 --- a/tests/V8Isolate_ThrowException_with_external.phpt +++ b/tests/V8Isolate_throwException_with_external.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\Isolate::ThrowException() - exception object is still the same +V8\Isolate::throwException() - exception object is still the same --SKIPIF-- --FILE-- @@ -15,23 +15,23 @@ $isolate = new \V8\Isolate(); $context = new \V8\Context($isolate); $v8_helper->injectConsoleLog($context); -$global = $context->GlobalObject(); +$global = $context->globalObject(); try { // associating external exception with non-object v8 values is not possible - $isolate->ThrowException($context, new \V8\StringValue($isolate, 'test'), new RuntimeException('test')); + $isolate->throwException($context, new \V8\StringValue($isolate, 'test'), new RuntimeException('test')); } catch (\V8\Exceptions\ValueException $e) { $helper->exception_export($e); } -$v8_exception = \V8\Exception::Error($context, new \V8\StringValue($isolate, 'test')); +$v8_exception = \V8\Exception::error($context, new \V8\StringValue($isolate, 'test')); $func_tpl = new \V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $info) use (&$v8_exception) { - $info->GetIsolate()->ThrowException($info->GetContext(), $v8_exception, new RuntimeException('test')); + $info->getIsolate()->throwException($info->getContext(), $v8_exception, new RuntimeException('test')); }); -$global->Set($context, new \V8\StringValue($isolate, 'e'), $func_tpl); +$global->set($context, new \V8\StringValue($isolate, 'e'), $func_tpl); try { @@ -39,9 +39,9 @@ try { } catch (\V8\Exceptions\TryCatchException $e) { $helper->exception_export($e); - $helper->assert('Thrown exception object is the same', $e->GetTryCatch()->Exception(), $v8_exception); + $helper->assert('Thrown exception object is the same', $e->getTryCatch()->exception(), $v8_exception); - $helper->exception_export($e->GetTryCatch()->getExternalException()); + $helper->exception_export($e->getTryCatch()->getExternalException()); } $v8_helper->CompileRun($context, 'try {e()} catch(e) {}'); @@ -49,20 +49,20 @@ $v8_helper->CompileRun($context, 'try {e()} catch(e) {}'); try { // when we catch thrown exception within v8 runtime, we can't un-wire association, so it becomes illegal to reuse // the same v8 object exception to throw with external exception again - $isolate->ThrowException($context, $v8_exception, new RuntimeException('test')); + $isolate->throwException($context, $v8_exception, new RuntimeException('test')); } catch (\V8\Exceptions\ValueException $e) { $helper->exception_export($e); } -$v8_exception = \V8\Exception::Error($context, new \V8\StringValue($isolate, 'test')); +$v8_exception = \V8\Exception::error($context, new \V8\StringValue($isolate, 'test')); // re-throw the same v8 object after it was propagated through TryCatch mechanism is OK -$isolate->ThrowException($context, $v8_exception, new RuntimeException('test')); +$isolate->throwException($context, $v8_exception, new RuntimeException('test')); try { // re-throw v8 object while it has not been propagated through TryCatch mechanism is NOT OK - $isolate->ThrowException($context, $v8_exception, new RuntimeException('test')); + $isolate->throwException($context, $v8_exception, new RuntimeException('test')); } catch (\V8\Exceptions\ValueException $e) { $helper->exception_export($e); } diff --git a/tests/V8MapObject.phpt b/tests/V8MapObject.phpt index 5563865..799c8b7 100644 --- a/tests/V8MapObject.phpt +++ b/tests/V8MapObject.phpt @@ -26,27 +26,27 @@ $helper->space(); $helper->assert('MapObject extends Value', $value instanceof \V8\Value); $helper->assert('MapObject does not extend PrimitiveValue', !($value instanceof \V8\PrimitiveValue)); $helper->assert('MapObject implements AdjustableExternalMemoryInterface', $value instanceof \V8\AdjustableExternalMemoryInterface); -$helper->assert('MapObject is instanceof Map', $value->InstanceOf($context, $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'Map')))); +$helper->assert('MapObject is instanceof Map', $value->instanceOf($context, $context->globalObject()->get($context, new \V8\StringValue($isolate, 'Map')))); $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_matches($value, 'GetContext', $context); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_matches($value, 'getContext', $context); $helper->space(); $helper->header('Getters'); -$helper->assert('GetIdentityHash is integer', gettype($value->GetIdentityHash()), 'integer'); +$helper->assert('GetIdentityHash is integer', gettype($value->getIdentityHash()), 'integer'); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); $helper->header('Converters'); -$helper->dump_object_methods($value, ['@@default' => [$context]], new RegexpFilter('/^To/')); +$helper->dump_object_methods($value, ['@@default' => [$context]], new RegexpFilter('/^to/')); $helper->space(); $helper->header('New value creation from V8 runtime'); -$filter = new ArrayListFilter(['IsObject', 'IsMap', 'IsWeakMap', 'IsSet', 'IsWeakSet'], false); +$filter = new ArrayListFilter(['isObject', 'isMap', 'isWeakMap', 'isSet', 'isWeakSet'], false); $new_map = $v8_helper->CompileRun($context, "new Map()"); $helper->assert('New map from V8 is instance of \V8\MapObject', $new_map instanceof \V8\MapObject); $helper->dump_object_methods($new_map, [], $filter); @@ -64,36 +64,36 @@ $key = new \V8\ObjectValue($context); $nonexistent_key = new \V8\ObjectValue($context); $val = new \V8\ObjectValue($context); -$helper->method_export($value, 'Size'); -$helper->assert('Can set value', $value->Set($context, $key, $val), $value); -$helper->assert('Value exists', $value->Has($context, $key)); -$helper->assert('Can get value', $value->Get($context, $key), $val); -$helper->assert('Nonexistent value does not exists', $value->Has($context, $nonexistent_key), false); -$helper->assert('Getting nonexistent value returns undefined', ($ret = $value->Get($context, $nonexistent_key)) instanceof \V8\Value && $ret->IsUndefined()); +$helper->method_export($value, 'size'); +$helper->assert('Can set value', $value->set($context, $key, $val), $value); +$helper->assert('Value exists', $value->has($context, $key)); +$helper->assert('Can get value', $value->get($context, $key), $val); +$helper->assert('Nonexistent value does not exists', $value->has($context, $nonexistent_key), false); +$helper->assert('Getting nonexistent value returns undefined', ($ret = $value->get($context, $nonexistent_key)) instanceof \V8\Value && $ret->isUndefined()); $helper->line(); -$helper->method_export($value, 'Size'); -$helper->method_matches_instanceof($value, 'AsArray', \V8\ArrayObject::class); +$helper->method_export($value, 'size'); +$helper->method_matches_instanceof($value, 'asArray', \V8\ArrayObject::class); $helper->line(); -$arr = $value->AsArray(); -$helper->assert('MapObject Array representation has valid length', $arr->Length() == 2); -$helper->assert('MapObject Array contains key', $arr->Get($context, new \V8\Uint32Value($isolate, 0)), $key); -$helper->assert('MapObject Array contains value', $arr->Get($context, new \V8\Uint32Value($isolate, 1)), $val); +$arr = $value->asArray(); +$helper->assert('MapObject Array representation has valid length', $arr->length() == 2); +$helper->assert('MapObject Array contains key', $arr->get($context, new \V8\Uint32Value($isolate, 0)), $key); +$helper->assert('MapObject Array contains value', $arr->get($context, new \V8\Uint32Value($isolate, 1)), $val); $helper->line(); -$helper->assert('Delete existent value', $value->Delete($context, $key)); -$helper->assert('Deleted value does not exists', $value->Has($context, $key), false); -$helper->assert('Delete nonexistent value fails', $value->Delete($context, $nonexistent_key), false); -$helper->assert('Deleted nonexistent value does not exists', $value->Has($context, $nonexistent_key), false); -$helper->method_export($value, 'Size'); +$helper->assert('Delete existent value', $value->delete($context, $key)); +$helper->assert('Deleted value does not exists', $value->has($context, $key), false); +$helper->assert('Delete nonexistent value fails', $value->delete($context, $nonexistent_key), false); +$helper->assert('Deleted nonexistent value does not exists', $value->has($context, $nonexistent_key), false); +$helper->method_export($value, 'size'); $helper->line(); -$value->Set($context, new \V8\NumberValue($isolate, 1), $val); -$value->Set($context, new \V8\NumberValue($isolate, 2), $val); -$helper->method_export($value, 'Size'); -$helper->method_export($value, 'Clear'); -$helper->method_export($value, 'Size'); +$value->set($context, new \V8\NumberValue($isolate, 1), $val); +$value->set($context, new \V8\NumberValue($isolate, 2), $val); +$helper->method_export($value, 'size'); +$helper->method_export($value, 'clear'); +$helper->method_export($value, 'size'); ?> @@ -120,8 +120,8 @@ MapObject is instanceof Map: ok Accessors: ---------- -V8\MapObject::GetIsolate() matches expected value -V8\MapObject::GetContext() matches expected value +V8\MapObject::getIsolate() matches expected value +V8\MapObject::getContext() matches expected value Getters: @@ -131,87 +131,87 @@ GetIdentityHash is integer: ok Checkers: --------- -V8\MapObject(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\MapObject(V8\ObjectValue)->IsCallable(): bool(false) -V8\MapObject(V8\ObjectValue)->IsConstructor(): bool(false) -V8\MapObject(V8\Value)->IsUndefined(): bool(false) -V8\MapObject(V8\Value)->IsNull(): bool(false) -V8\MapObject(V8\Value)->IsNullOrUndefined(): bool(false) -V8\MapObject(V8\Value)->IsTrue(): bool(false) -V8\MapObject(V8\Value)->IsFalse(): bool(false) -V8\MapObject(V8\Value)->IsName(): bool(false) -V8\MapObject(V8\Value)->IsString(): bool(false) -V8\MapObject(V8\Value)->IsSymbol(): bool(false) -V8\MapObject(V8\Value)->IsFunction(): bool(false) -V8\MapObject(V8\Value)->IsArray(): bool(false) -V8\MapObject(V8\Value)->IsObject(): bool(true) -V8\MapObject(V8\Value)->IsBoolean(): bool(false) -V8\MapObject(V8\Value)->IsNumber(): bool(false) -V8\MapObject(V8\Value)->IsInt32(): bool(false) -V8\MapObject(V8\Value)->IsUint32(): bool(false) -V8\MapObject(V8\Value)->IsDate(): bool(false) -V8\MapObject(V8\Value)->IsArgumentsObject(): bool(false) -V8\MapObject(V8\Value)->IsBooleanObject(): bool(false) -V8\MapObject(V8\Value)->IsNumberObject(): bool(false) -V8\MapObject(V8\Value)->IsStringObject(): bool(false) -V8\MapObject(V8\Value)->IsSymbolObject(): bool(false) -V8\MapObject(V8\Value)->IsNativeError(): bool(false) -V8\MapObject(V8\Value)->IsRegExp(): bool(false) -V8\MapObject(V8\Value)->IsAsyncFunction(): bool(false) -V8\MapObject(V8\Value)->IsGeneratorFunction(): bool(false) -V8\MapObject(V8\Value)->IsGeneratorObject(): bool(false) -V8\MapObject(V8\Value)->IsPromise(): bool(false) -V8\MapObject(V8\Value)->IsMap(): bool(true) -V8\MapObject(V8\Value)->IsSet(): bool(false) -V8\MapObject(V8\Value)->IsMapIterator(): bool(false) -V8\MapObject(V8\Value)->IsSetIterator(): bool(false) -V8\MapObject(V8\Value)->IsWeakMap(): bool(false) -V8\MapObject(V8\Value)->IsWeakSet(): bool(false) -V8\MapObject(V8\Value)->IsArrayBuffer(): bool(false) -V8\MapObject(V8\Value)->IsArrayBufferView(): bool(false) -V8\MapObject(V8\Value)->IsTypedArray(): bool(false) -V8\MapObject(V8\Value)->IsUint8Array(): bool(false) -V8\MapObject(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\MapObject(V8\Value)->IsInt8Array(): bool(false) -V8\MapObject(V8\Value)->IsUint16Array(): bool(false) -V8\MapObject(V8\Value)->IsInt16Array(): bool(false) -V8\MapObject(V8\Value)->IsUint32Array(): bool(false) -V8\MapObject(V8\Value)->IsInt32Array(): bool(false) -V8\MapObject(V8\Value)->IsFloat32Array(): bool(false) -V8\MapObject(V8\Value)->IsFloat64Array(): bool(false) -V8\MapObject(V8\Value)->IsDataView(): bool(false) -V8\MapObject(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\MapObject(V8\Value)->IsProxy(): bool(false) +V8\MapObject(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\MapObject(V8\ObjectValue)->isCallable(): bool(false) +V8\MapObject(V8\ObjectValue)->isConstructor(): bool(false) +V8\MapObject(V8\Value)->isUndefined(): bool(false) +V8\MapObject(V8\Value)->isNull(): bool(false) +V8\MapObject(V8\Value)->isNullOrUndefined(): bool(false) +V8\MapObject(V8\Value)->isTrue(): bool(false) +V8\MapObject(V8\Value)->isFalse(): bool(false) +V8\MapObject(V8\Value)->isName(): bool(false) +V8\MapObject(V8\Value)->isString(): bool(false) +V8\MapObject(V8\Value)->isSymbol(): bool(false) +V8\MapObject(V8\Value)->isFunction(): bool(false) +V8\MapObject(V8\Value)->isArray(): bool(false) +V8\MapObject(V8\Value)->isObject(): bool(true) +V8\MapObject(V8\Value)->isBoolean(): bool(false) +V8\MapObject(V8\Value)->isNumber(): bool(false) +V8\MapObject(V8\Value)->isInt32(): bool(false) +V8\MapObject(V8\Value)->isUint32(): bool(false) +V8\MapObject(V8\Value)->isDate(): bool(false) +V8\MapObject(V8\Value)->isArgumentsObject(): bool(false) +V8\MapObject(V8\Value)->isBooleanObject(): bool(false) +V8\MapObject(V8\Value)->isNumberObject(): bool(false) +V8\MapObject(V8\Value)->isStringObject(): bool(false) +V8\MapObject(V8\Value)->isSymbolObject(): bool(false) +V8\MapObject(V8\Value)->isNativeError(): bool(false) +V8\MapObject(V8\Value)->isRegExp(): bool(false) +V8\MapObject(V8\Value)->isAsyncFunction(): bool(false) +V8\MapObject(V8\Value)->isGeneratorFunction(): bool(false) +V8\MapObject(V8\Value)->isGeneratorObject(): bool(false) +V8\MapObject(V8\Value)->isPromise(): bool(false) +V8\MapObject(V8\Value)->isMap(): bool(true) +V8\MapObject(V8\Value)->isSet(): bool(false) +V8\MapObject(V8\Value)->isMapIterator(): bool(false) +V8\MapObject(V8\Value)->isSetIterator(): bool(false) +V8\MapObject(V8\Value)->isWeakMap(): bool(false) +V8\MapObject(V8\Value)->isWeakSet(): bool(false) +V8\MapObject(V8\Value)->isArrayBuffer(): bool(false) +V8\MapObject(V8\Value)->isArrayBufferView(): bool(false) +V8\MapObject(V8\Value)->isTypedArray(): bool(false) +V8\MapObject(V8\Value)->isUint8Array(): bool(false) +V8\MapObject(V8\Value)->isUint8ClampedArray(): bool(false) +V8\MapObject(V8\Value)->isInt8Array(): bool(false) +V8\MapObject(V8\Value)->isUint16Array(): bool(false) +V8\MapObject(V8\Value)->isInt16Array(): bool(false) +V8\MapObject(V8\Value)->isUint32Array(): bool(false) +V8\MapObject(V8\Value)->isInt32Array(): bool(false) +V8\MapObject(V8\Value)->isFloat32Array(): bool(false) +V8\MapObject(V8\Value)->isFloat64Array(): bool(false) +V8\MapObject(V8\Value)->isDataView(): bool(false) +V8\MapObject(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\MapObject(V8\Value)->isProxy(): bool(false) Converters: ----------- -V8\MapObject(V8\Value)->ToBoolean(): +V8\MapObject(V8\Value)->toBoolean(): object(V8\BooleanValue)#120 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\MapObject(V8\Value)->ToNumber(): +V8\MapObject(V8\Value)->toNumber(): object(V8\NumberValue)#120 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\MapObject(V8\Value)->ToString(): +V8\MapObject(V8\Value)->toString(): object(V8\StringValue)#120 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\MapObject(V8\Value)->ToDetailString(): +V8\MapObject(V8\Value)->toDetailString(): object(V8\StringValue)#120 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\MapObject(V8\Value)->ToObject(): +V8\MapObject(V8\Value)->toObject(): object(V8\MapObject)#6 (2) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { @@ -223,55 +223,55 @@ V8\MapObject(V8\Value)->ToObject(): } } } -V8\MapObject(V8\Value)->ToInteger(): +V8\MapObject(V8\Value)->toInteger(): object(V8\Int32Value)#120 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\MapObject(V8\Value)->ToUint32(): +V8\MapObject(V8\Value)->toUint32(): object(V8\Int32Value)#120 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\MapObject(V8\Value)->ToInt32(): +V8\MapObject(V8\Value)->toInt32(): object(V8\Int32Value)#120 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\MapObject(V8\Value)->ToArrayIndex(): V8\Exceptions\Exception: Failed to convert +V8\MapObject(V8\Value)->toArrayIndex(): V8\Exceptions\Exception: Failed to convert New value creation from V8 runtime: ----------------------------------- New map from V8 is instance of \V8\MapObject: ok -V8\MapObject(V8\Value)->IsObject(): bool(true) -V8\MapObject(V8\Value)->IsMap(): bool(true) -V8\MapObject(V8\Value)->IsSet(): bool(false) -V8\MapObject(V8\Value)->IsWeakMap(): bool(false) -V8\MapObject(V8\Value)->IsWeakSet(): bool(false) +V8\MapObject(V8\Value)->isObject(): bool(true) +V8\MapObject(V8\Value)->isMap(): bool(true) +V8\MapObject(V8\Value)->isSet(): bool(false) +V8\MapObject(V8\Value)->isWeakMap(): bool(false) +V8\MapObject(V8\Value)->isWeakSet(): bool(false) New weak map from V8 is NOT an instance of \V8\MapObject: ok -V8\ObjectValue(V8\Value)->IsObject(): bool(true) -V8\ObjectValue(V8\Value)->IsMap(): bool(false) -V8\ObjectValue(V8\Value)->IsSet(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakMap(): bool(true) -V8\ObjectValue(V8\Value)->IsWeakSet(): bool(false) +V8\ObjectValue(V8\Value)->isObject(): bool(true) +V8\ObjectValue(V8\Value)->isMap(): bool(false) +V8\ObjectValue(V8\Value)->isSet(): bool(false) +V8\ObjectValue(V8\Value)->isWeakMap(): bool(true) +V8\ObjectValue(V8\Value)->isWeakSet(): bool(false) Class-specific methods: ----------------------- -V8\MapObject->Size(): float(0) +V8\MapObject->size(): float(0) Can set value: ok Value exists: ok Can get value: ok Nonexistent value does not exists: ok Getting nonexistent value returns undefined: ok -V8\MapObject->Size(): float(1) -V8\MapObject::AsArray() result is instance of V8\ArrayObject +V8\MapObject->size(): float(1) +V8\MapObject::asArray() result is instance of V8\ArrayObject MapObject Array representation has valid length: ok MapObject Array contains key: ok @@ -281,8 +281,8 @@ Delete existent value: ok Deleted value does not exists: ok Delete nonexistent value fails: ok Deleted nonexistent value does not exists: ok -V8\MapObject->Size(): float(0) +V8\MapObject->size(): float(0) -V8\MapObject->Size(): float(2) -V8\MapObject->Clear(): NULL -V8\MapObject->Size(): float(0) +V8\MapObject->size(): float(2) +V8\MapObject->clear(): NULL +V8\MapObject->size(): float(0) diff --git a/tests/V8Message.phpt b/tests/V8Message.phpt index 97ed228..f9876b4 100644 --- a/tests/V8Message.phpt +++ b/tests/V8Message.phpt @@ -21,18 +21,18 @@ $helper->dump($obj); $helper->space(); $helper->header('Test getters (default)'); -$helper->method_matches_with_output($obj, 'Get', 'message'); -$helper->method_matches_with_output($obj, 'GetSourceLine', 'source_line'); -$helper->method_matches_instanceof($obj, 'GetScriptOrigin', V8\ScriptOrigin::class); -$helper->method_matches_with_output($obj, 'GetScriptResourceName', 'resource_name'); -$helper->method_matches_instanceof($obj, 'GetStackTrace', V8\StackTrace::class); -$helper->method_matches_with_output($obj, 'GetLineNumber', 0); -$helper->method_matches_with_output($obj, 'GetStartPosition', -1); -$helper->method_matches_with_output($obj, 'GetEndPosition', -1); -$helper->method_matches_with_output($obj, 'GetStartColumn', 0); -$helper->method_matches_with_output($obj, 'GetEndColumn', 0); -$helper->method_matches_with_output($obj, 'IsSharedCrossOrigin', false); -$helper->method_matches_with_output($obj, 'IsOpaque', false); +$helper->method_matches_with_output($obj, 'get', 'message'); +$helper->method_matches_with_output($obj, 'getSourceLine', 'source_line'); +$helper->method_matches_instanceof($obj, 'getScriptOrigin', V8\ScriptOrigin::class); +$helper->method_matches_with_output($obj, 'getScriptResourceName', 'resource_name'); +$helper->method_matches_instanceof($obj, 'getStackTrace', V8\StackTrace::class); +$helper->method_matches_with_output($obj, 'getLineNumber', 0); +$helper->method_matches_with_output($obj, 'getStartPosition', -1); +$helper->method_matches_with_output($obj, 'getEndPosition', -1); +$helper->method_matches_with_output($obj, 'getStartColumn', 0); +$helper->method_matches_with_output($obj, 'getEndColumn', 0); +$helper->method_matches_with_output($obj, 'isSharedCrossOrigin', false); +$helper->method_matches_with_output($obj, 'isOpaque', false); $helper->space(); @@ -43,18 +43,18 @@ $helper->dump($obj); $helper->space(); $helper->header('Test getters'); -$helper->method_matches_with_output($obj, 'Get', 'message'); -$helper->method_matches_with_output($obj, 'GetSourceLine', 'source_line'); -$helper->method_matches_instanceof($obj, 'GetScriptOrigin', V8\ScriptOrigin::class); -$helper->method_matches_with_output($obj, 'GetScriptResourceName', 'resource_name'); -$helper->method_matches_instanceof($obj, 'GetStackTrace', V8\StackTrace::class); -$helper->method_matches_with_output($obj, 'GetLineNumber', 1); -$helper->method_matches_with_output($obj, 'GetStartPosition', 2); -$helper->method_matches_with_output($obj, 'GetEndPosition', 3); -$helper->method_matches_with_output($obj, 'GetStartColumn', 4); -$helper->method_matches_with_output($obj, 'GetEndColumn', 5); -$helper->method_matches_with_output($obj, 'IsSharedCrossOrigin', true); -$helper->method_matches_with_output($obj, 'IsOpaque', true); +$helper->method_matches_with_output($obj, 'get', 'message'); +$helper->method_matches_with_output($obj, 'getSourceLine', 'source_line'); +$helper->method_matches_instanceof($obj, 'getScriptOrigin', V8\ScriptOrigin::class); +$helper->method_matches_with_output($obj, 'getScriptResourceName', 'resource_name'); +$helper->method_matches_instanceof($obj, 'getStackTrace', V8\StackTrace::class); +$helper->method_matches_with_output($obj, 'getLineNumber', 1); +$helper->method_matches_with_output($obj, 'getStartPosition', 2); +$helper->method_matches_with_output($obj, 'getEndPosition', 3); +$helper->method_matches_with_output($obj, 'getStartColumn', 4); +$helper->method_matches_with_output($obj, 'getEndColumn', 5); +$helper->method_matches_with_output($obj, 'isSharedCrossOrigin', true); +$helper->method_matches_with_output($obj, 'isOpaque', true); $helper->space(); ?> @@ -117,18 +117,18 @@ object(V8\Message)#7 (12) { Test getters (default): ----------------------- -V8\Message::Get() matches expected 'message' -V8\Message::GetSourceLine() matches expected 'source_line' -V8\Message::GetScriptOrigin() result is instance of V8\ScriptOrigin -V8\Message::GetScriptResourceName() matches expected 'resource_name' -V8\Message::GetStackTrace() result is instance of V8\StackTrace -V8\Message::GetLineNumber() matches expected 0 -V8\Message::GetStartPosition() matches expected -1 -V8\Message::GetEndPosition() matches expected -1 -V8\Message::GetStartColumn() matches expected 0 -V8\Message::GetEndColumn() matches expected 0 -V8\Message::IsSharedCrossOrigin() matches expected false -V8\Message::IsOpaque() matches expected false +V8\Message::get() matches expected 'message' +V8\Message::getSourceLine() matches expected 'source_line' +V8\Message::getScriptOrigin() result is instance of V8\ScriptOrigin +V8\Message::getScriptResourceName() matches expected 'resource_name' +V8\Message::getStackTrace() result is instance of V8\StackTrace +V8\Message::getLineNumber() matches expected 0 +V8\Message::getStartPosition() matches expected -1 +V8\Message::getEndPosition() matches expected -1 +V8\Message::getStartColumn() matches expected 0 +V8\Message::getEndColumn() matches expected 0 +V8\Message::isSharedCrossOrigin() matches expected false +V8\Message::isOpaque() matches expected false Object representation: @@ -189,15 +189,15 @@ object(V8\Message)#8 (12) { Test getters: ------------- -V8\Message::Get() matches expected 'message' -V8\Message::GetSourceLine() matches expected 'source_line' -V8\Message::GetScriptOrigin() result is instance of V8\ScriptOrigin -V8\Message::GetScriptResourceName() matches expected 'resource_name' -V8\Message::GetStackTrace() result is instance of V8\StackTrace -V8\Message::GetLineNumber() matches expected 1 -V8\Message::GetStartPosition() matches expected 2 -V8\Message::GetEndPosition() matches expected 3 -V8\Message::GetStartColumn() matches expected 4 -V8\Message::GetEndColumn() matches expected 5 -V8\Message::IsSharedCrossOrigin() matches expected true -V8\Message::IsOpaque() matches expected true +V8\Message::get() matches expected 'message' +V8\Message::getSourceLine() matches expected 'source_line' +V8\Message::getScriptOrigin() result is instance of V8\ScriptOrigin +V8\Message::getScriptResourceName() matches expected 'resource_name' +V8\Message::getStackTrace() result is instance of V8\StackTrace +V8\Message::getLineNumber() matches expected 1 +V8\Message::getStartPosition() matches expected 2 +V8\Message::getEndPosition() matches expected 3 +V8\Message::getStartColumn() matches expected 4 +V8\Message::getEndColumn() matches expected 5 +V8\Message::isSharedCrossOrigin() matches expected true +V8\Message::isOpaque() matches expected true diff --git a/tests/V8NullValue.phpt b/tests/V8NullValue.phpt index 5de774f..6782977 100644 --- a/tests/V8NullValue.phpt +++ b/tests/V8NullValue.phpt @@ -26,8 +26,8 @@ $helper->assert('NullValue extends PrimitiveValue', $value instanceof \V8\Primit $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_export($value, 'Value'); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_export($value, 'value'); $helper->space(); @@ -38,15 +38,15 @@ $context = new \V8\Context($isolate, $global_template); $helper->header('Primitive converters'); -$helper->method_export($value, 'BooleanValue', [$context]); -$helper->method_export($value, 'NumberValue', [$context]); +$helper->method_export($value, 'booleanValue', [$context]); +$helper->method_export($value, 'numberValue', [$context]); $helper->space(); -$string = $value->ToString($context); +$string = $value->toString($context); -$helper->header(get_class($value) .'::ToString() converting'); +$helper->header(get_class($value) .'::toString() converting'); $helper->dump($string); -$helper->dump($string->Value()); +$helper->dump($string->value()); ?> --EXPECT-- @@ -63,71 +63,71 @@ NullValue extends PrimitiveValue: ok Accessors: ---------- -V8\NullValue::GetIsolate() matches expected value -V8\NullValue->Value(): NULL +V8\NullValue::getIsolate() matches expected value +V8\NullValue->value(): NULL Checkers: --------- -V8\NullValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\NullValue(V8\Value)->IsUndefined(): bool(false) -V8\NullValue(V8\Value)->IsNull(): bool(true) -V8\NullValue(V8\Value)->IsNullOrUndefined(): bool(true) -V8\NullValue(V8\Value)->IsTrue(): bool(false) -V8\NullValue(V8\Value)->IsFalse(): bool(false) -V8\NullValue(V8\Value)->IsName(): bool(false) -V8\NullValue(V8\Value)->IsString(): bool(false) -V8\NullValue(V8\Value)->IsSymbol(): bool(false) -V8\NullValue(V8\Value)->IsFunction(): bool(false) -V8\NullValue(V8\Value)->IsArray(): bool(false) -V8\NullValue(V8\Value)->IsObject(): bool(false) -V8\NullValue(V8\Value)->IsBoolean(): bool(false) -V8\NullValue(V8\Value)->IsNumber(): bool(false) -V8\NullValue(V8\Value)->IsInt32(): bool(false) -V8\NullValue(V8\Value)->IsUint32(): bool(false) -V8\NullValue(V8\Value)->IsDate(): bool(false) -V8\NullValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\NullValue(V8\Value)->IsBooleanObject(): bool(false) -V8\NullValue(V8\Value)->IsNumberObject(): bool(false) -V8\NullValue(V8\Value)->IsStringObject(): bool(false) -V8\NullValue(V8\Value)->IsSymbolObject(): bool(false) -V8\NullValue(V8\Value)->IsNativeError(): bool(false) -V8\NullValue(V8\Value)->IsRegExp(): bool(false) -V8\NullValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\NullValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\NullValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\NullValue(V8\Value)->IsPromise(): bool(false) -V8\NullValue(V8\Value)->IsMap(): bool(false) -V8\NullValue(V8\Value)->IsSet(): bool(false) -V8\NullValue(V8\Value)->IsMapIterator(): bool(false) -V8\NullValue(V8\Value)->IsSetIterator(): bool(false) -V8\NullValue(V8\Value)->IsWeakMap(): bool(false) -V8\NullValue(V8\Value)->IsWeakSet(): bool(false) -V8\NullValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\NullValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\NullValue(V8\Value)->IsTypedArray(): bool(false) -V8\NullValue(V8\Value)->IsUint8Array(): bool(false) -V8\NullValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\NullValue(V8\Value)->IsInt8Array(): bool(false) -V8\NullValue(V8\Value)->IsUint16Array(): bool(false) -V8\NullValue(V8\Value)->IsInt16Array(): bool(false) -V8\NullValue(V8\Value)->IsUint32Array(): bool(false) -V8\NullValue(V8\Value)->IsInt32Array(): bool(false) -V8\NullValue(V8\Value)->IsFloat32Array(): bool(false) -V8\NullValue(V8\Value)->IsFloat64Array(): bool(false) -V8\NullValue(V8\Value)->IsDataView(): bool(false) -V8\NullValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\NullValue(V8\Value)->IsProxy(): bool(false) +V8\NullValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\NullValue(V8\Value)->isUndefined(): bool(false) +V8\NullValue(V8\Value)->isNull(): bool(true) +V8\NullValue(V8\Value)->isNullOrUndefined(): bool(true) +V8\NullValue(V8\Value)->isTrue(): bool(false) +V8\NullValue(V8\Value)->isFalse(): bool(false) +V8\NullValue(V8\Value)->isName(): bool(false) +V8\NullValue(V8\Value)->isString(): bool(false) +V8\NullValue(V8\Value)->isSymbol(): bool(false) +V8\NullValue(V8\Value)->isFunction(): bool(false) +V8\NullValue(V8\Value)->isArray(): bool(false) +V8\NullValue(V8\Value)->isObject(): bool(false) +V8\NullValue(V8\Value)->isBoolean(): bool(false) +V8\NullValue(V8\Value)->isNumber(): bool(false) +V8\NullValue(V8\Value)->isInt32(): bool(false) +V8\NullValue(V8\Value)->isUint32(): bool(false) +V8\NullValue(V8\Value)->isDate(): bool(false) +V8\NullValue(V8\Value)->isArgumentsObject(): bool(false) +V8\NullValue(V8\Value)->isBooleanObject(): bool(false) +V8\NullValue(V8\Value)->isNumberObject(): bool(false) +V8\NullValue(V8\Value)->isStringObject(): bool(false) +V8\NullValue(V8\Value)->isSymbolObject(): bool(false) +V8\NullValue(V8\Value)->isNativeError(): bool(false) +V8\NullValue(V8\Value)->isRegExp(): bool(false) +V8\NullValue(V8\Value)->isAsyncFunction(): bool(false) +V8\NullValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\NullValue(V8\Value)->isGeneratorObject(): bool(false) +V8\NullValue(V8\Value)->isPromise(): bool(false) +V8\NullValue(V8\Value)->isMap(): bool(false) +V8\NullValue(V8\Value)->isSet(): bool(false) +V8\NullValue(V8\Value)->isMapIterator(): bool(false) +V8\NullValue(V8\Value)->isSetIterator(): bool(false) +V8\NullValue(V8\Value)->isWeakMap(): bool(false) +V8\NullValue(V8\Value)->isWeakSet(): bool(false) +V8\NullValue(V8\Value)->isArrayBuffer(): bool(false) +V8\NullValue(V8\Value)->isArrayBufferView(): bool(false) +V8\NullValue(V8\Value)->isTypedArray(): bool(false) +V8\NullValue(V8\Value)->isUint8Array(): bool(false) +V8\NullValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\NullValue(V8\Value)->isInt8Array(): bool(false) +V8\NullValue(V8\Value)->isUint16Array(): bool(false) +V8\NullValue(V8\Value)->isInt16Array(): bool(false) +V8\NullValue(V8\Value)->isUint32Array(): bool(false) +V8\NullValue(V8\Value)->isInt32Array(): bool(false) +V8\NullValue(V8\Value)->isFloat32Array(): bool(false) +V8\NullValue(V8\Value)->isFloat64Array(): bool(false) +V8\NullValue(V8\Value)->isDataView(): bool(false) +V8\NullValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\NullValue(V8\Value)->isProxy(): bool(false) Primitive converters: --------------------- -V8\NullValue(V8\Value)->BooleanValue(): bool(false) -V8\NullValue(V8\Value)->NumberValue(): float(0) +V8\NullValue(V8\Value)->booleanValue(): bool(false) +V8\NullValue(V8\Value)->numberValue(): float(0) -V8\NullValue::ToString() converting: +V8\NullValue::toString() converting: ------------------------------------ object(V8\StringValue)#79 (1) { ["isolate":"V8\Value":private]=> diff --git a/tests/V8NumberObject.phpt b/tests/V8NumberObject.phpt index 72059a3..cee7ea3 100644 --- a/tests/V8NumberObject.phpt +++ b/tests/V8NumberObject.phpt @@ -24,16 +24,16 @@ $helper->dump($value); $helper->space(); $helper->assert('NumberObject extends ObjectValue', $value instanceof \V8\ObjectValue); -$helper->assert('NumberObject is instanceof Number', $value->InstanceOf($context, $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'Number')))); +$helper->assert('NumberObject is instanceof Number', $value->instanceOf($context, $context->globalObject()->get($context, new \V8\StringValue($isolate, 'Number')))); $helper->line(); $helper->header('Getters'); -$helper->method_export($value, 'ValueOf'); +$helper->method_export($value, 'valueOf'); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'val'), $value); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'val'), $value); $source = ' console.log("val: ", val); @@ -43,7 +43,7 @@ val'; $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context); +$res = $script->run($context); $helper->space(); $helper->header('Returned value should be the same'); @@ -54,7 +54,7 @@ $source = 'new Number(11.22);'; $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context); +$res = $script->run($context); $v8_helper->run_checks($res, 'Checkers on boxed from script'); @@ -81,63 +81,63 @@ NumberObject is instanceof Number: ok Getters: -------- -V8\NumberObject->ValueOf(): float(42.12) +V8\NumberObject->valueOf(): float(42.12) Checkers: --------- -V8\NumberObject(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\NumberObject(V8\ObjectValue)->IsCallable(): bool(false) -V8\NumberObject(V8\ObjectValue)->IsConstructor(): bool(false) -V8\NumberObject(V8\Value)->IsUndefined(): bool(false) -V8\NumberObject(V8\Value)->IsNull(): bool(false) -V8\NumberObject(V8\Value)->IsNullOrUndefined(): bool(false) -V8\NumberObject(V8\Value)->IsTrue(): bool(false) -V8\NumberObject(V8\Value)->IsFalse(): bool(false) -V8\NumberObject(V8\Value)->IsName(): bool(false) -V8\NumberObject(V8\Value)->IsString(): bool(false) -V8\NumberObject(V8\Value)->IsSymbol(): bool(false) -V8\NumberObject(V8\Value)->IsFunction(): bool(false) -V8\NumberObject(V8\Value)->IsArray(): bool(false) -V8\NumberObject(V8\Value)->IsObject(): bool(true) -V8\NumberObject(V8\Value)->IsBoolean(): bool(false) -V8\NumberObject(V8\Value)->IsNumber(): bool(false) -V8\NumberObject(V8\Value)->IsInt32(): bool(false) -V8\NumberObject(V8\Value)->IsUint32(): bool(false) -V8\NumberObject(V8\Value)->IsDate(): bool(false) -V8\NumberObject(V8\Value)->IsArgumentsObject(): bool(false) -V8\NumberObject(V8\Value)->IsBooleanObject(): bool(false) -V8\NumberObject(V8\Value)->IsNumberObject(): bool(true) -V8\NumberObject(V8\Value)->IsStringObject(): bool(false) -V8\NumberObject(V8\Value)->IsSymbolObject(): bool(false) -V8\NumberObject(V8\Value)->IsNativeError(): bool(false) -V8\NumberObject(V8\Value)->IsRegExp(): bool(false) -V8\NumberObject(V8\Value)->IsAsyncFunction(): bool(false) -V8\NumberObject(V8\Value)->IsGeneratorFunction(): bool(false) -V8\NumberObject(V8\Value)->IsGeneratorObject(): bool(false) -V8\NumberObject(V8\Value)->IsPromise(): bool(false) -V8\NumberObject(V8\Value)->IsMap(): bool(false) -V8\NumberObject(V8\Value)->IsSet(): bool(false) -V8\NumberObject(V8\Value)->IsMapIterator(): bool(false) -V8\NumberObject(V8\Value)->IsSetIterator(): bool(false) -V8\NumberObject(V8\Value)->IsWeakMap(): bool(false) -V8\NumberObject(V8\Value)->IsWeakSet(): bool(false) -V8\NumberObject(V8\Value)->IsArrayBuffer(): bool(false) -V8\NumberObject(V8\Value)->IsArrayBufferView(): bool(false) -V8\NumberObject(V8\Value)->IsTypedArray(): bool(false) -V8\NumberObject(V8\Value)->IsUint8Array(): bool(false) -V8\NumberObject(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\NumberObject(V8\Value)->IsInt8Array(): bool(false) -V8\NumberObject(V8\Value)->IsUint16Array(): bool(false) -V8\NumberObject(V8\Value)->IsInt16Array(): bool(false) -V8\NumberObject(V8\Value)->IsUint32Array(): bool(false) -V8\NumberObject(V8\Value)->IsInt32Array(): bool(false) -V8\NumberObject(V8\Value)->IsFloat32Array(): bool(false) -V8\NumberObject(V8\Value)->IsFloat64Array(): bool(false) -V8\NumberObject(V8\Value)->IsDataView(): bool(false) -V8\NumberObject(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\NumberObject(V8\Value)->IsProxy(): bool(false) +V8\NumberObject(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\NumberObject(V8\ObjectValue)->isCallable(): bool(false) +V8\NumberObject(V8\ObjectValue)->isConstructor(): bool(false) +V8\NumberObject(V8\Value)->isUndefined(): bool(false) +V8\NumberObject(V8\Value)->isNull(): bool(false) +V8\NumberObject(V8\Value)->isNullOrUndefined(): bool(false) +V8\NumberObject(V8\Value)->isTrue(): bool(false) +V8\NumberObject(V8\Value)->isFalse(): bool(false) +V8\NumberObject(V8\Value)->isName(): bool(false) +V8\NumberObject(V8\Value)->isString(): bool(false) +V8\NumberObject(V8\Value)->isSymbol(): bool(false) +V8\NumberObject(V8\Value)->isFunction(): bool(false) +V8\NumberObject(V8\Value)->isArray(): bool(false) +V8\NumberObject(V8\Value)->isObject(): bool(true) +V8\NumberObject(V8\Value)->isBoolean(): bool(false) +V8\NumberObject(V8\Value)->isNumber(): bool(false) +V8\NumberObject(V8\Value)->isInt32(): bool(false) +V8\NumberObject(V8\Value)->isUint32(): bool(false) +V8\NumberObject(V8\Value)->isDate(): bool(false) +V8\NumberObject(V8\Value)->isArgumentsObject(): bool(false) +V8\NumberObject(V8\Value)->isBooleanObject(): bool(false) +V8\NumberObject(V8\Value)->isNumberObject(): bool(true) +V8\NumberObject(V8\Value)->isStringObject(): bool(false) +V8\NumberObject(V8\Value)->isSymbolObject(): bool(false) +V8\NumberObject(V8\Value)->isNativeError(): bool(false) +V8\NumberObject(V8\Value)->isRegExp(): bool(false) +V8\NumberObject(V8\Value)->isAsyncFunction(): bool(false) +V8\NumberObject(V8\Value)->isGeneratorFunction(): bool(false) +V8\NumberObject(V8\Value)->isGeneratorObject(): bool(false) +V8\NumberObject(V8\Value)->isPromise(): bool(false) +V8\NumberObject(V8\Value)->isMap(): bool(false) +V8\NumberObject(V8\Value)->isSet(): bool(false) +V8\NumberObject(V8\Value)->isMapIterator(): bool(false) +V8\NumberObject(V8\Value)->isSetIterator(): bool(false) +V8\NumberObject(V8\Value)->isWeakMap(): bool(false) +V8\NumberObject(V8\Value)->isWeakSet(): bool(false) +V8\NumberObject(V8\Value)->isArrayBuffer(): bool(false) +V8\NumberObject(V8\Value)->isArrayBufferView(): bool(false) +V8\NumberObject(V8\Value)->isTypedArray(): bool(false) +V8\NumberObject(V8\Value)->isUint8Array(): bool(false) +V8\NumberObject(V8\Value)->isUint8ClampedArray(): bool(false) +V8\NumberObject(V8\Value)->isInt8Array(): bool(false) +V8\NumberObject(V8\Value)->isUint16Array(): bool(false) +V8\NumberObject(V8\Value)->isInt16Array(): bool(false) +V8\NumberObject(V8\Value)->isUint32Array(): bool(false) +V8\NumberObject(V8\Value)->isInt32Array(): bool(false) +V8\NumberObject(V8\Value)->isFloat32Array(): bool(false) +V8\NumberObject(V8\Value)->isFloat64Array(): bool(false) +V8\NumberObject(V8\Value)->isDataView(): bool(false) +V8\NumberObject(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\NumberObject(V8\Value)->isProxy(): bool(false) val: 42.12 @@ -151,55 +151,55 @@ Expected value is identical to actual value Checkers on boxed from script: ------------------------------ -V8\NumberObject(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\NumberObject(V8\ObjectValue)->IsCallable(): bool(false) -V8\NumberObject(V8\ObjectValue)->IsConstructor(): bool(false) -V8\NumberObject(V8\Value)->IsUndefined(): bool(false) -V8\NumberObject(V8\Value)->IsNull(): bool(false) -V8\NumberObject(V8\Value)->IsNullOrUndefined(): bool(false) -V8\NumberObject(V8\Value)->IsTrue(): bool(false) -V8\NumberObject(V8\Value)->IsFalse(): bool(false) -V8\NumberObject(V8\Value)->IsName(): bool(false) -V8\NumberObject(V8\Value)->IsString(): bool(false) -V8\NumberObject(V8\Value)->IsSymbol(): bool(false) -V8\NumberObject(V8\Value)->IsFunction(): bool(false) -V8\NumberObject(V8\Value)->IsArray(): bool(false) -V8\NumberObject(V8\Value)->IsObject(): bool(true) -V8\NumberObject(V8\Value)->IsBoolean(): bool(false) -V8\NumberObject(V8\Value)->IsNumber(): bool(false) -V8\NumberObject(V8\Value)->IsInt32(): bool(false) -V8\NumberObject(V8\Value)->IsUint32(): bool(false) -V8\NumberObject(V8\Value)->IsDate(): bool(false) -V8\NumberObject(V8\Value)->IsArgumentsObject(): bool(false) -V8\NumberObject(V8\Value)->IsBooleanObject(): bool(false) -V8\NumberObject(V8\Value)->IsNumberObject(): bool(true) -V8\NumberObject(V8\Value)->IsStringObject(): bool(false) -V8\NumberObject(V8\Value)->IsSymbolObject(): bool(false) -V8\NumberObject(V8\Value)->IsNativeError(): bool(false) -V8\NumberObject(V8\Value)->IsRegExp(): bool(false) -V8\NumberObject(V8\Value)->IsAsyncFunction(): bool(false) -V8\NumberObject(V8\Value)->IsGeneratorFunction(): bool(false) -V8\NumberObject(V8\Value)->IsGeneratorObject(): bool(false) -V8\NumberObject(V8\Value)->IsPromise(): bool(false) -V8\NumberObject(V8\Value)->IsMap(): bool(false) -V8\NumberObject(V8\Value)->IsSet(): bool(false) -V8\NumberObject(V8\Value)->IsMapIterator(): bool(false) -V8\NumberObject(V8\Value)->IsSetIterator(): bool(false) -V8\NumberObject(V8\Value)->IsWeakMap(): bool(false) -V8\NumberObject(V8\Value)->IsWeakSet(): bool(false) -V8\NumberObject(V8\Value)->IsArrayBuffer(): bool(false) -V8\NumberObject(V8\Value)->IsArrayBufferView(): bool(false) -V8\NumberObject(V8\Value)->IsTypedArray(): bool(false) -V8\NumberObject(V8\Value)->IsUint8Array(): bool(false) -V8\NumberObject(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\NumberObject(V8\Value)->IsInt8Array(): bool(false) -V8\NumberObject(V8\Value)->IsUint16Array(): bool(false) -V8\NumberObject(V8\Value)->IsInt16Array(): bool(false) -V8\NumberObject(V8\Value)->IsUint32Array(): bool(false) -V8\NumberObject(V8\Value)->IsInt32Array(): bool(false) -V8\NumberObject(V8\Value)->IsFloat32Array(): bool(false) -V8\NumberObject(V8\Value)->IsFloat64Array(): bool(false) -V8\NumberObject(V8\Value)->IsDataView(): bool(false) -V8\NumberObject(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\NumberObject(V8\Value)->IsProxy(): bool(false) +V8\NumberObject(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\NumberObject(V8\ObjectValue)->isCallable(): bool(false) +V8\NumberObject(V8\ObjectValue)->isConstructor(): bool(false) +V8\NumberObject(V8\Value)->isUndefined(): bool(false) +V8\NumberObject(V8\Value)->isNull(): bool(false) +V8\NumberObject(V8\Value)->isNullOrUndefined(): bool(false) +V8\NumberObject(V8\Value)->isTrue(): bool(false) +V8\NumberObject(V8\Value)->isFalse(): bool(false) +V8\NumberObject(V8\Value)->isName(): bool(false) +V8\NumberObject(V8\Value)->isString(): bool(false) +V8\NumberObject(V8\Value)->isSymbol(): bool(false) +V8\NumberObject(V8\Value)->isFunction(): bool(false) +V8\NumberObject(V8\Value)->isArray(): bool(false) +V8\NumberObject(V8\Value)->isObject(): bool(true) +V8\NumberObject(V8\Value)->isBoolean(): bool(false) +V8\NumberObject(V8\Value)->isNumber(): bool(false) +V8\NumberObject(V8\Value)->isInt32(): bool(false) +V8\NumberObject(V8\Value)->isUint32(): bool(false) +V8\NumberObject(V8\Value)->isDate(): bool(false) +V8\NumberObject(V8\Value)->isArgumentsObject(): bool(false) +V8\NumberObject(V8\Value)->isBooleanObject(): bool(false) +V8\NumberObject(V8\Value)->isNumberObject(): bool(true) +V8\NumberObject(V8\Value)->isStringObject(): bool(false) +V8\NumberObject(V8\Value)->isSymbolObject(): bool(false) +V8\NumberObject(V8\Value)->isNativeError(): bool(false) +V8\NumberObject(V8\Value)->isRegExp(): bool(false) +V8\NumberObject(V8\Value)->isAsyncFunction(): bool(false) +V8\NumberObject(V8\Value)->isGeneratorFunction(): bool(false) +V8\NumberObject(V8\Value)->isGeneratorObject(): bool(false) +V8\NumberObject(V8\Value)->isPromise(): bool(false) +V8\NumberObject(V8\Value)->isMap(): bool(false) +V8\NumberObject(V8\Value)->isSet(): bool(false) +V8\NumberObject(V8\Value)->isMapIterator(): bool(false) +V8\NumberObject(V8\Value)->isSetIterator(): bool(false) +V8\NumberObject(V8\Value)->isWeakMap(): bool(false) +V8\NumberObject(V8\Value)->isWeakSet(): bool(false) +V8\NumberObject(V8\Value)->isArrayBuffer(): bool(false) +V8\NumberObject(V8\Value)->isArrayBufferView(): bool(false) +V8\NumberObject(V8\Value)->isTypedArray(): bool(false) +V8\NumberObject(V8\Value)->isUint8Array(): bool(false) +V8\NumberObject(V8\Value)->isUint8ClampedArray(): bool(false) +V8\NumberObject(V8\Value)->isInt8Array(): bool(false) +V8\NumberObject(V8\Value)->isUint16Array(): bool(false) +V8\NumberObject(V8\Value)->isInt16Array(): bool(false) +V8\NumberObject(V8\Value)->isUint32Array(): bool(false) +V8\NumberObject(V8\Value)->isInt32Array(): bool(false) +V8\NumberObject(V8\Value)->isFloat32Array(): bool(false) +V8\NumberObject(V8\Value)->isFloat64Array(): bool(false) +V8\NumberObject(V8\Value)->isDataView(): bool(false) +V8\NumberObject(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\NumberObject(V8\Value)->isProxy(): bool(false) diff --git a/tests/V8NumberValue.phpt b/tests/V8NumberValue.phpt index 81ed08f..aea307b 100644 --- a/tests/V8NumberValue.phpt +++ b/tests/V8NumberValue.phpt @@ -25,8 +25,8 @@ $helper->assert('NumberValue extends PrimitiveValue', $value instanceof \V8\Prim $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_export($value, 'Value'); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_export($value, 'value'); $helper->space(); @@ -36,25 +36,25 @@ $global_template = new \V8\ObjectTemplate($isolate); $context = new \V8\Context($isolate, $global_template); -$string = $value->ToString($context); +$string = $value->toString($context); -$helper->header(get_class($value) .'::ToString() converting'); +$helper->header(get_class($value) .'::toString() converting'); $helper->dump($string); -$helper->dump($string->Value()); +$helper->dump($string->value()); $helper->space(); $helper->header('Primitive converters'); -$helper->method_export($value, 'BooleanValue', [$context]); -$helper->method_export($value, 'NumberValue', [$context]); +$helper->method_export($value, 'booleanValue', [$context]); +$helper->method_export($value, 'numberValue', [$context]); $helper->space(); $helper->header('Test negative value in constructor'); $value = new V8\NumberValue($isolate, -123.456); -$helper->method_export($value, 'Value'); -$helper->method_export($value, 'BooleanValue', [$context]); -$helper->method_export($value, 'NumberValue', [$context]); +$helper->method_export($value, 'value'); +$helper->method_export($value, 'booleanValue', [$context]); +$helper->method_export($value, 'numberValue', [$context]); $helper->space(); $helper->header('Test non-standard constructor values'); @@ -63,9 +63,9 @@ foreach ([null, true, false, NAN, INF, -INF] as $val) { try { $value = new V8\NumberValue($isolate, $val); $helper->value_export($val); - $helper->method_export($value, 'Value'); - $helper->method_export($value, 'BooleanValue', [$context]); - $helper->method_export($value, 'NumberValue', [$context]); + $helper->method_export($value, 'value'); + $helper->method_export($value, 'booleanValue', [$context]); + $helper->method_export($value, 'numberValue', [$context]); } catch (Throwable $e) { $helper->exception_export($e); } @@ -88,65 +88,65 @@ NumberValue extends PrimitiveValue: ok Accessors: ---------- -V8\NumberValue::GetIsolate() matches expected value -V8\NumberValue->Value(): float(123.456) +V8\NumberValue::getIsolate() matches expected value +V8\NumberValue->value(): float(123.456) Checkers: --------- -V8\NumberValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "number" - -V8\NumberValue(V8\Value)->IsUndefined(): bool(false) -V8\NumberValue(V8\Value)->IsNull(): bool(false) -V8\NumberValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\NumberValue(V8\Value)->IsTrue(): bool(false) -V8\NumberValue(V8\Value)->IsFalse(): bool(false) -V8\NumberValue(V8\Value)->IsName(): bool(false) -V8\NumberValue(V8\Value)->IsString(): bool(false) -V8\NumberValue(V8\Value)->IsSymbol(): bool(false) -V8\NumberValue(V8\Value)->IsFunction(): bool(false) -V8\NumberValue(V8\Value)->IsArray(): bool(false) -V8\NumberValue(V8\Value)->IsObject(): bool(false) -V8\NumberValue(V8\Value)->IsBoolean(): bool(false) -V8\NumberValue(V8\Value)->IsNumber(): bool(true) -V8\NumberValue(V8\Value)->IsInt32(): bool(false) -V8\NumberValue(V8\Value)->IsUint32(): bool(false) -V8\NumberValue(V8\Value)->IsDate(): bool(false) -V8\NumberValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\NumberValue(V8\Value)->IsBooleanObject(): bool(false) -V8\NumberValue(V8\Value)->IsNumberObject(): bool(false) -V8\NumberValue(V8\Value)->IsStringObject(): bool(false) -V8\NumberValue(V8\Value)->IsSymbolObject(): bool(false) -V8\NumberValue(V8\Value)->IsNativeError(): bool(false) -V8\NumberValue(V8\Value)->IsRegExp(): bool(false) -V8\NumberValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\NumberValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\NumberValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\NumberValue(V8\Value)->IsPromise(): bool(false) -V8\NumberValue(V8\Value)->IsMap(): bool(false) -V8\NumberValue(V8\Value)->IsSet(): bool(false) -V8\NumberValue(V8\Value)->IsMapIterator(): bool(false) -V8\NumberValue(V8\Value)->IsSetIterator(): bool(false) -V8\NumberValue(V8\Value)->IsWeakMap(): bool(false) -V8\NumberValue(V8\Value)->IsWeakSet(): bool(false) -V8\NumberValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\NumberValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\NumberValue(V8\Value)->IsTypedArray(): bool(false) -V8\NumberValue(V8\Value)->IsUint8Array(): bool(false) -V8\NumberValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\NumberValue(V8\Value)->IsInt8Array(): bool(false) -V8\NumberValue(V8\Value)->IsUint16Array(): bool(false) -V8\NumberValue(V8\Value)->IsInt16Array(): bool(false) -V8\NumberValue(V8\Value)->IsUint32Array(): bool(false) -V8\NumberValue(V8\Value)->IsInt32Array(): bool(false) -V8\NumberValue(V8\Value)->IsFloat32Array(): bool(false) -V8\NumberValue(V8\Value)->IsFloat64Array(): bool(false) -V8\NumberValue(V8\Value)->IsDataView(): bool(false) -V8\NumberValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\NumberValue(V8\Value)->IsProxy(): bool(false) - - -V8\NumberValue::ToString() converting: +V8\NumberValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "number" + +V8\NumberValue(V8\Value)->isUndefined(): bool(false) +V8\NumberValue(V8\Value)->isNull(): bool(false) +V8\NumberValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\NumberValue(V8\Value)->isTrue(): bool(false) +V8\NumberValue(V8\Value)->isFalse(): bool(false) +V8\NumberValue(V8\Value)->isName(): bool(false) +V8\NumberValue(V8\Value)->isString(): bool(false) +V8\NumberValue(V8\Value)->isSymbol(): bool(false) +V8\NumberValue(V8\Value)->isFunction(): bool(false) +V8\NumberValue(V8\Value)->isArray(): bool(false) +V8\NumberValue(V8\Value)->isObject(): bool(false) +V8\NumberValue(V8\Value)->isBoolean(): bool(false) +V8\NumberValue(V8\Value)->isNumber(): bool(true) +V8\NumberValue(V8\Value)->isInt32(): bool(false) +V8\NumberValue(V8\Value)->isUint32(): bool(false) +V8\NumberValue(V8\Value)->isDate(): bool(false) +V8\NumberValue(V8\Value)->isArgumentsObject(): bool(false) +V8\NumberValue(V8\Value)->isBooleanObject(): bool(false) +V8\NumberValue(V8\Value)->isNumberObject(): bool(false) +V8\NumberValue(V8\Value)->isStringObject(): bool(false) +V8\NumberValue(V8\Value)->isSymbolObject(): bool(false) +V8\NumberValue(V8\Value)->isNativeError(): bool(false) +V8\NumberValue(V8\Value)->isRegExp(): bool(false) +V8\NumberValue(V8\Value)->isAsyncFunction(): bool(false) +V8\NumberValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\NumberValue(V8\Value)->isGeneratorObject(): bool(false) +V8\NumberValue(V8\Value)->isPromise(): bool(false) +V8\NumberValue(V8\Value)->isMap(): bool(false) +V8\NumberValue(V8\Value)->isSet(): bool(false) +V8\NumberValue(V8\Value)->isMapIterator(): bool(false) +V8\NumberValue(V8\Value)->isSetIterator(): bool(false) +V8\NumberValue(V8\Value)->isWeakMap(): bool(false) +V8\NumberValue(V8\Value)->isWeakSet(): bool(false) +V8\NumberValue(V8\Value)->isArrayBuffer(): bool(false) +V8\NumberValue(V8\Value)->isArrayBufferView(): bool(false) +V8\NumberValue(V8\Value)->isTypedArray(): bool(false) +V8\NumberValue(V8\Value)->isUint8Array(): bool(false) +V8\NumberValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\NumberValue(V8\Value)->isInt8Array(): bool(false) +V8\NumberValue(V8\Value)->isUint16Array(): bool(false) +V8\NumberValue(V8\Value)->isInt16Array(): bool(false) +V8\NumberValue(V8\Value)->isUint32Array(): bool(false) +V8\NumberValue(V8\Value)->isInt32Array(): bool(false) +V8\NumberValue(V8\Value)->isFloat32Array(): bool(false) +V8\NumberValue(V8\Value)->isFloat64Array(): bool(false) +V8\NumberValue(V8\Value)->isDataView(): bool(false) +V8\NumberValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\NumberValue(V8\Value)->isProxy(): bool(false) + + +V8\NumberValue::toString() converting: -------------------------------------- object(V8\StringValue)#79 (1) { ["isolate":"V8\Value":private]=> @@ -158,15 +158,15 @@ string(7) "123.456" Primitive converters: --------------------- -V8\NumberValue(V8\Value)->BooleanValue(): bool(true) -V8\NumberValue(V8\Value)->NumberValue(): float(123.456) +V8\NumberValue(V8\Value)->booleanValue(): bool(true) +V8\NumberValue(V8\Value)->numberValue(): float(123.456) Test negative value in constructor: ----------------------------------- -V8\NumberValue->Value(): float(-123.456) -V8\NumberValue(V8\Value)->BooleanValue(): bool(true) -V8\NumberValue(V8\Value)->NumberValue(): float(-123.456) +V8\NumberValue->value(): float(-123.456) +V8\NumberValue(V8\Value)->booleanValue(): bool(true) +V8\NumberValue(V8\Value)->numberValue(): float(-123.456) Test non-standard constructor values: @@ -175,30 +175,30 @@ TypeError: Argument 2 passed to V8\NumberValue::__construct() must be of the typ boolean: true -V8\NumberValue->Value(): float(1) -V8\NumberValue(V8\Value)->BooleanValue(): bool(true) -V8\NumberValue(V8\Value)->NumberValue(): float(1) +V8\NumberValue->value(): float(1) +V8\NumberValue(V8\Value)->booleanValue(): bool(true) +V8\NumberValue(V8\Value)->numberValue(): float(1) boolean: false -V8\NumberValue->Value(): float(0) -V8\NumberValue(V8\Value)->BooleanValue(): bool(false) -V8\NumberValue(V8\Value)->NumberValue(): float(0) +V8\NumberValue->value(): float(0) +V8\NumberValue(V8\Value)->booleanValue(): bool(false) +V8\NumberValue(V8\Value)->numberValue(): float(0) double: NAN -V8\NumberValue->Value(): float(NAN) -V8\NumberValue(V8\Value)->BooleanValue(): bool(false) -V8\NumberValue(V8\Value)->NumberValue(): float(NAN) +V8\NumberValue->value(): float(NAN) +V8\NumberValue(V8\Value)->booleanValue(): bool(false) +V8\NumberValue(V8\Value)->numberValue(): float(NAN) double: INF -V8\NumberValue->Value(): float(INF) -V8\NumberValue(V8\Value)->BooleanValue(): bool(true) -V8\NumberValue(V8\Value)->NumberValue(): float(INF) +V8\NumberValue->value(): float(INF) +V8\NumberValue(V8\Value)->booleanValue(): bool(true) +V8\NumberValue(V8\Value)->numberValue(): float(INF) double: -INF -V8\NumberValue->Value(): float(-INF) -V8\NumberValue(V8\Value)->BooleanValue(): bool(true) -V8\NumberValue(V8\Value)->NumberValue(): float(-INF) +V8\NumberValue->value(): float(-INF) +V8\NumberValue(V8\Value)->booleanValue(): bool(true) +V8\NumberValue(V8\Value)->numberValue(): float(-INF) diff --git a/tests/V8ObjectTemplate.phpt b/tests/V8ObjectTemplate.phpt index f396ddf..f90aacd 100644 --- a/tests/V8ObjectTemplate.phpt +++ b/tests/V8ObjectTemplate.phpt @@ -25,7 +25,7 @@ $helper->assert('ObjectTemplate implements AdjustableExternalMemoryInterface', $ $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); +$helper->method_matches($value, 'getIsolate', $isolate); $helper->line(); $callback = function() { @@ -33,14 +33,14 @@ $callback = function() { }; $fnc = new \V8\FunctionTemplate($isolate, $callback); -$fnc->SetClassName(new \V8\StringValue($isolate, 'TestConstructor')); +$fnc->setClassName(new \V8\StringValue($isolate, 'TestConstructor')); $context = new \V8\Context($isolate); $value = new \V8\ObjectTemplate($isolate, $fnc); -$instance = $value->NewInstance($context); +$instance = $value->newInstance($context); -$helper->assert('ObjectTemplate instance has name from constructor', $instance->GetConstructorName()->Value() == 'TestConstructor'); +$helper->assert('ObjectTemplate instance has name from constructor', $instance->getConstructorName()->value() == 'TestConstructor'); ?> @@ -59,6 +59,6 @@ ObjectTemplate implements AdjustableExternalMemoryInterface: ok Accessors: ---------- -V8\ObjectTemplate::GetIsolate() matches expected value +V8\ObjectTemplate::getIsolate() matches expected value ObjectTemplate instance has name from constructor: ok diff --git a/tests/V8ObjectTemplate_Set.phpt b/tests/V8ObjectTemplate_set.phpt similarity index 72% rename from tests/V8ObjectTemplate_Set.phpt rename to tests/V8ObjectTemplate_set.phpt index bee8e11..cb45950 100644 --- a/tests/V8ObjectTemplate_Set.phpt +++ b/tests/V8ObjectTemplate_set.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectTemplate::Set() - FunctionTemplate +V8\ObjectTemplate::set() - FunctionTemplate --SKIPIF-- --FILE-- @@ -16,8 +16,8 @@ $test = new \V8\FunctionTemplate($isolate, $fnc); $test2 = new \V8\FunctionTemplate($isolate, $fnc); -$global_template->Set(new \V8\StringValue($isolate, 'test'), $test); -$global_template->Set(new \V8\StringValue($isolate, 'test2'), $test2); +$global_template->set(new \V8\StringValue($isolate, 'test'), $test); +$global_template->set(new \V8\StringValue($isolate, 'test2'), $test2); echo 'Done here for now', PHP_EOL; ?> diff --git a/tests/V8ObjectTemplate_SetAccessor_receiver.phpt b/tests/V8ObjectTemplate_setAccessor_receiver.phpt similarity index 84% rename from tests/V8ObjectTemplate_SetAccessor_receiver.phpt rename to tests/V8ObjectTemplate_setAccessor_receiver.phpt index 3ea99af..1cee83b 100644 --- a/tests/V8ObjectTemplate_SetAccessor_receiver.phpt +++ b/tests/V8ObjectTemplate_setAccessor_receiver.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectTemplate::SetAccessor() - with receiver +V8\ObjectTemplate::setAccessor() - with receiver --SKIPIF-- InstanceTemplate(); -$inst->SetAccessor(new \V8\StringValue($isolate, 'foo'), $getter, $setter, \V8\AccessControl::DEFAULT_ACCESS, \V8\PropertyAttribute::None, $templ); +$inst = $templ->instanceTemplate(); +$inst->setAccessor(new \V8\StringValue($isolate, 'foo'), $getter, $setter, \V8\AccessControl::DEFAULT_ACCESS, \V8\PropertyAttribute::None, $templ); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'f'), $templ->GetFunction($context)); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'f'), $templ->getFunction($context)); $helper->header('Testing positive'); $obj = $v8_helper->CompileRun($context, "var obj = new f(); obj"); -$v8_helper->CHECK($templ->HasInstance($obj), '$obj instance of $templ'); +$v8_helper->CHECK($templ->hasInstance($obj), '$obj instance of $templ'); // Test path through generic runtime code. $v8_helper->CompileRun($context, "obj.foo"); @@ -50,7 +50,7 @@ $helper->line(); $helper->header('Testing negative'); $obj = $v8_helper->CompileRun($context, "var obj = {}; obj.__proto__ = new f(); obj"); -$v8_helper->CHECK(!$templ->HasInstance($obj), '$obj is not an instance of $templ'); +$v8_helper->CHECK(!$templ->hasInstance($obj), '$obj is not an instance of $templ'); // Test path through generic runtime code. try { diff --git a/tests/V8ObjectTemplate_SetCallAsFunctionHandler.phpt b/tests/V8ObjectTemplate_setCallAsFunctionHandler.phpt similarity index 78% rename from tests/V8ObjectTemplate_SetCallAsFunctionHandler.phpt rename to tests/V8ObjectTemplate_setCallAsFunctionHandler.phpt index 28b3e89..5fce57a 100644 --- a/tests/V8ObjectTemplate_SetCallAsFunctionHandler.phpt +++ b/tests/V8ObjectTemplate_setCallAsFunctionHandler.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectTemplate::SetCallAsFunctionHandler +V8\ObjectTemplate::setCallAsFunctionHandler --SKIPIF-- --FILE-- @@ -19,21 +19,21 @@ $callback = function (\V8\FunctionCallbackInfo $info) { // here we know that only Values with Value() method will be provided /** @var \V8\StringValue $arg */ - foreach($info->Arguments() as $arg) { - $out[] = $arg->Value(); + foreach($info->arguments() as $arg) { + $out[] = $arg->value(); } echo implode(' ', $out), PHP_EOL; - $info->GetReturnValue()->Set(new \V8\StringValue($info->GetIsolate(), 'done')); + $info->getReturnValue()->set(new \V8\StringValue($info->getIsolate(), 'done')); }; $test_obj_tpl = new \V8\ObjectTemplate($isolate); -$test_obj_tpl->SetCallAsFunctionHandler($callback); +$test_obj_tpl->setCallAsFunctionHandler($callback); -$global_template->Set(new \V8\StringValue($isolate, 'func'), new \V8\FunctionTemplate($isolate)); -$global_template->Set(new \V8\StringValue($isolate, 'test'), $test_obj_tpl); -$global_template->Set(new \V8\StringValue($isolate, 'test2'), new \V8\ObjectTemplate($isolate)); +$global_template->set(new \V8\StringValue($isolate, 'func'), new \V8\FunctionTemplate($isolate)); +$global_template->set(new \V8\StringValue($isolate, 'test'), $test_obj_tpl); +$global_template->set(new \V8\StringValue($isolate, 'test2'), new \V8\ObjectTemplate($isolate)); $context = new V8\Context($isolate, $global_template); $v8_helper->injectConsoleLog($context); @@ -62,7 +62,7 @@ try { $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context); +$res = $script->run($context); ?> --EXPECT-- diff --git a/tests/V8ObjectTemplate_SetHandlerForIndexedProperty.phpt b/tests/V8ObjectTemplate_setHandlerForIndexedProperty.phpt similarity index 82% rename from tests/V8ObjectTemplate_SetHandlerForIndexedProperty.phpt rename to tests/V8ObjectTemplate_setHandlerForIndexedProperty.phpt index aa59f96..c8ade7c 100644 --- a/tests/V8ObjectTemplate_SetHandlerForIndexedProperty.phpt +++ b/tests/V8ObjectTemplate_setHandlerForIndexedProperty.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectTemplate::SetHandlerForIndexedProperty() +V8\ObjectTemplate::setHandlerForIndexedProperty() --SKIPIF-- --FILE-- @@ -20,17 +20,17 @@ $getter = function (int $index, \V8\PropertyCallbackInfo $info) use (&$foo) { echo 'I am indexed getter for ', $index, '!', PHP_EOL; if (1 === $index) { - $info->GetReturnValue()->SetUndefined(); + $info->getReturnValue()->setUndefined(); return; } - $info->GetReturnValue()->Set(new \V8\NumberValue($info->GetIsolate(), $foo)); + $info->getReturnValue()->set(new \V8\NumberValue($info->getIsolate(), $foo)); }; $setter = function (int $index, \V8\Value $value, \V8\PropertyCallbackInfo $info) use (&$foo) { echo 'I am indexed setter for ', $index, '!', PHP_EOL; - $foo = $value->ToNumber($info->GetContext())->Value() / 2; + $foo = $value->toNumber($info->getContext())->value() / 2; }; $query = function ($index, \V8\PropertyCallbackInfo $info) use (&$foo) { @@ -40,24 +40,24 @@ $query = function ($index, \V8\PropertyCallbackInfo $info) use (&$foo) { return; } - $info->GetReturnValue()->SetInteger(\V8\PropertyAttribute::None); + $info->getReturnValue()->setInteger(\V8\PropertyAttribute::None); }; $deleter = function (int $index, \V8\PropertyCallbackInfo $info) use (&$foo) { echo 'I am indexed deleter for ', $index, '!', PHP_EOL; -// $info->GetReturnValue()->Set(true); +// $info->getReturnValue()->set(true); }; $enumerator = function (\V8\PropertyCallbackInfo $info) use (&$foo) { echo 'I am indexed enumerator!', PHP_EOL; - $ctxt = $info->GetContext(); + $ctxt = $info->getContext(); $arr = new \V8\ArrayObject($ctxt); for ($i =0; $i < 10; $i ++) { - $arr->Set($ctxt, new \V8\Uint32Value($info->GetIsolate(), $i), new \V8\NumberValue($info->GetIsolate(), $i)); + $arr->set($ctxt, new \V8\Uint32Value($info->getIsolate(), $i), new \V8\NumberValue($info->getIsolate(), $i)); } - $info->GetReturnValue()->Set($arr); + $info->getReturnValue()->set($arr); }; $test = function () { @@ -70,9 +70,9 @@ $test = function () { $test_obj_tpl = new \V8\ObjectTemplate($isolate); -$test_obj_tpl->SetHandlerForIndexedProperty(new \V8\IndexedPropertyHandlerConfiguration($getter, $setter, $query, $deleter, $enumerator)); +$test_obj_tpl->setHandlerForIndexedProperty(new \V8\IndexedPropertyHandlerConfiguration($getter, $setter, $query, $deleter, $enumerator)); -$global_template->Set(new \V8\StringValue($isolate, 'test'), $test_obj_tpl); +$global_template->set(new \V8\StringValue($isolate, 'test'), $test_obj_tpl); $context = new V8\Context($isolate, $global_template); $v8_helper->injectConsoleLog($context); @@ -99,7 +99,7 @@ for (i in test) { $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context); +$res = $script->run($context); ?> --EXPECT-- diff --git a/tests/V8ObjectTemplate_SetHandlerForNamedProperty.phpt b/tests/V8ObjectTemplate_setHandlerForNamedProperty.phpt similarity index 73% rename from tests/V8ObjectTemplate_SetHandlerForNamedProperty.phpt rename to tests/V8ObjectTemplate_setHandlerForNamedProperty.phpt index 0d1d360..9755245 100644 --- a/tests/V8ObjectTemplate_SetHandlerForNamedProperty.phpt +++ b/tests/V8ObjectTemplate_setHandlerForNamedProperty.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectTemplate::SetHandlerForNamedProperty() +V8\ObjectTemplate::setHandlerForNamedProperty() --SKIPIF-- --FILE-- @@ -17,49 +17,49 @@ $global_template = new V8\ObjectTemplate($isolate); $foo = 100; $getter = function (\V8\NameValue $name, \V8\PropertyCallbackInfo $info) use (&$foo) { - echo 'I am named getter for ', $name->ToString($info->GetContext())->Value(), '!', PHP_EOL; + echo 'I am named getter for ', $name->toString($info->getContext())->value(), '!', PHP_EOL; if ('bar' === $name) { - $info->GetReturnValue()->SetUndefined(); + $info->getReturnValue()->setUndefined(); return; } - $info->GetReturnValue()->Set(new \V8\NumberValue($info->GetIsolate(), $foo)); + $info->getReturnValue()->set(new \V8\NumberValue($info->getIsolate(), $foo)); }; $setter = function (\V8\NameValue $name, \V8\Value $value, \V8\PropertyCallbackInfo $info) use (&$foo) { - echo 'I am named setter for ', $name->ToString($info->GetContext())->Value(), '!', PHP_EOL; + echo 'I am named setter for ', $name->toString($info->getContext())->value(), '!', PHP_EOL; - $foo = $value->ToNumber($info->GetContext())->Value() / 2; + $foo = $value->toNumber($info->getContext())->value() / 2; }; $query = function (\V8\NameValue$name, \V8\PropertyCallbackInfo $info) use (&$foo) { - echo 'I am named query for ', $name->ToString($info->GetContext())->Value(), '!', PHP_EOL; - $info->GetReturnValue()->SetInteger(\V8\PropertyAttribute::None); + echo 'I am named query for ', $name->toString($info->getContext())->value(), '!', PHP_EOL; + $info->getReturnValue()->setInteger(\V8\PropertyAttribute::None); }; $deleter = function (\V8\NameValue$name, \V8\PropertyCallbackInfo $info) use (&$foo) { - echo 'I am named deleter for ', $name->ToString($info->GetContext())->Value(), '!', PHP_EOL; -// $info->GetReturnValue()->Set(true); + echo 'I am named deleter for ', $name->toString($info->getContext())->value(), '!', PHP_EOL; +// $info->getReturnValue()->set(true); }; $enumerator = function (\V8\PropertyCallbackInfo $info) use (&$foo) { echo 'I am named enumerator!', PHP_EOL; - $ctxt = $info->GetContext(); + $ctxt = $info->getContext(); $arr = new \V8\ArrayObject($ctxt); for ($i =0, $j = 'test-a'; $i < 10; $i ++, $j++) { - $arr->Set($ctxt, new \V8\StringValue($info->GetIsolate(), $i), new \V8\StringValue($info->GetIsolate(), $j)); + $arr->set($ctxt, new \V8\StringValue($info->getIsolate(), $i), new \V8\StringValue($info->getIsolate(), $j)); } - $info->GetReturnValue()->Set($arr); + $info->getReturnValue()->set($arr); }; $test_obj_tpl = new \V8\ObjectTemplate($isolate); -$test_obj_tpl->SetHandlerForNamedProperty(new \V8\NamedPropertyHandlerConfiguration($getter, $setter, $query, $deleter, $enumerator)); +$test_obj_tpl->setHandlerForNamedProperty(new \V8\NamedPropertyHandlerConfiguration($getter, $setter, $query, $deleter, $enumerator)); -$global_template->Set(new \V8\StringValue($isolate, 'test'), $test_obj_tpl); +$global_template->set(new \V8\StringValue($isolate, 'test'), $test_obj_tpl); $context = new V8\Context($isolate, $global_template); $v8_helper->injectConsoleLog($context); @@ -83,7 +83,7 @@ for (i in test) { $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context); +$res = $script->run($context); ?> --EXPECT-- diff --git a/tests/V8ObjectTemplate_SetHandler_both.phpt b/tests/V8ObjectTemplate_setHandler_both.phpt similarity index 77% rename from tests/V8ObjectTemplate_SetHandler_both.phpt rename to tests/V8ObjectTemplate_setHandler_both.phpt index fec3260..23ca515 100644 --- a/tests/V8ObjectTemplate_SetHandler_both.phpt +++ b/tests/V8ObjectTemplate_setHandler_both.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectTemplate::SetHandlerFor{Named,Indexed}Property() +V8\ObjectTemplate::setHandlerFor{Named,Indexed}Property() --SKIPIF-- --FILE-- @@ -20,49 +20,49 @@ $allow_indexed = false; $foo = 100; $getter = function (\V8\NameValue $name, \V8\PropertyCallbackInfo $info) use (&$foo) { - echo 'I am named getter for ', $name->ToString($info->GetContext())->Value(), '!', PHP_EOL; + echo 'I am named getter for ', $name->toString($info->getContext())->value(), '!', PHP_EOL; if ('bar' === $name) { - $info->GetReturnValue()->SetUndefined(); + $info->getReturnValue()->setUndefined(); return; } - $info->GetReturnValue()->Set(new \V8\NumberValue($info->GetIsolate(), $foo)); + $info->getReturnValue()->set(new \V8\NumberValue($info->getIsolate(), $foo)); }; $setter = function (\V8\NameValue$name, \V8\Value $value, \V8\PropertyCallbackInfo $info) use (&$foo) { - echo 'I am named setter for ', $name->ToString($info->GetContext())->Value(), '!', PHP_EOL; + echo 'I am named setter for ', $name->toString($info->getContext())->value(), '!', PHP_EOL; - $foo = $value->ToNumber($info->GetContext())->Value() / 2; + $foo = $value->toNumber($info->getContext())->value() / 2; }; $query = function (\V8\NameValue$name, \V8\PropertyCallbackInfo $info) use (&$foo) { - echo 'I am named query for ', $name->ToString($info->GetContext())->Value(), '!', PHP_EOL; - $info->GetReturnValue()->SetInteger(\V8\PropertyAttribute::None); + echo 'I am named query for ', $name->toString($info->getContext())->value(), '!', PHP_EOL; + $info->getReturnValue()->setInteger(\V8\PropertyAttribute::None); }; $deleter = function (\V8\NameValue$name, \V8\PropertyCallbackInfo $info) use (&$foo) { - echo 'I am named deleter for ', $name->ToString($info->GetContext())->Value(), '!', PHP_EOL; -// $info->GetReturnValue()->Set(true); + echo 'I am named deleter for ', $name->toString($info->getContext())->value(), '!', PHP_EOL; +// $info->getReturnValue()->set(true); }; $enumerator = function (\V8\PropertyCallbackInfo $info) use (&$foo, &$allow_named) { echo 'I am named enumerator!', PHP_EOL; - $ctxt = $info->GetContext(); + $ctxt = $info->getContext(); $arr = new \V8\ArrayObject($ctxt); if ($allow_named) { for ($i =0, $j = 'test-a'; $i < 10; $i ++, $j++) { - $arr->Set($ctxt, new \V8\StringValue($info->GetIsolate(), $i), new \V8\StringValue($info->GetIsolate(), $j)); + $arr->set($ctxt, new \V8\StringValue($info->getIsolate(), $i), new \V8\StringValue($info->getIsolate(), $j)); } } - $info->GetReturnValue()->Set($arr); + $info->getReturnValue()->set($arr); }; $test_obj_tpl = new \V8\ObjectTemplate($isolate); -$test_obj_tpl->SetHandlerForNamedProperty(new \V8\NamedPropertyHandlerConfiguration($getter, $setter, $query, $deleter, $enumerator)); +$test_obj_tpl->setHandlerForNamedProperty(new \V8\NamedPropertyHandlerConfiguration($getter, $setter, $query, $deleter, $enumerator)); @@ -70,17 +70,17 @@ $getter = function (int $index, \V8\PropertyCallbackInfo $info) use (&$foo) { echo 'I am indexed getter for ', $index, '!', PHP_EOL; if (1 === $index) { - $info->GetReturnValue()->SetUndefined(); + $info->getReturnValue()->setUndefined(); return; } - $info->GetReturnValue()->Set(new \V8\NumberValue($info->GetIsolate(), $foo)); + $info->getReturnValue()->set(new \V8\NumberValue($info->getIsolate(), $foo)); }; $setter = function (int $index, \V8\Value $value, \V8\PropertyCallbackInfo $info) use (&$foo) { echo 'I am indexed setter for ', $index, '!', PHP_EOL; - $foo = $value->ToNumber($info->GetContext())->Value() / 2; + $foo = $value->toNumber($info->getContext())->value() / 2; }; $query = function ($index, \V8\PropertyCallbackInfo $info) use (&$foo) { @@ -90,32 +90,32 @@ $query = function ($index, \V8\PropertyCallbackInfo $info) use (&$foo) { return; } - $info->GetReturnValue()->SetInteger(\V8\PropertyAttribute::None); + $info->getReturnValue()->setInteger(\V8\PropertyAttribute::None); }; $deleter = function (int $index, \V8\PropertyCallbackInfo $info) use (&$foo) { echo 'I am indexed deleter for ', $index, '!', PHP_EOL; -// $info->GetReturnValue()->Set(true); +// $info->getReturnValue()->set(true); }; $enumerator = function (\V8\PropertyCallbackInfo $info) use (&$foo, &$allow_indexed) { echo 'I am indexed enumerator!', PHP_EOL; - $ctxt = $info->GetContext(); + $ctxt = $info->getContext(); $arr = new \V8\ArrayObject($ctxt); if ($allow_indexed) { for ($i =0; $i < 10; $i ++) { - $arr->Set($ctxt, new \V8\Uint32Value($info->GetIsolate(), $i), new \V8\NumberValue($info->GetIsolate(), $i)); + $arr->set($ctxt, new \V8\Uint32Value($info->getIsolate(), $i), new \V8\NumberValue($info->getIsolate(), $i)); } } - $info->GetReturnValue()->Set($arr); + $info->getReturnValue()->set($arr); }; -$test_obj_tpl->SetHandlerForIndexedProperty(new \V8\IndexedPropertyHandlerConfiguration($getter, $setter, $query, $deleter, $enumerator)); +$test_obj_tpl->setHandlerForIndexedProperty(new \V8\IndexedPropertyHandlerConfiguration($getter, $setter, $query, $deleter, $enumerator)); -$global_template->Set(new \V8\StringValue($isolate, 'test'), $test_obj_tpl); +$global_template->set(new \V8\StringValue($isolate, 'test'), $test_obj_tpl); $context = new V8\Context($isolate, $global_template); $v8_helper->injectConsoleLog($context); @@ -142,7 +142,7 @@ $allow_named = true; $allow_indexed = false; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context); +$res = $script->run($context); $helper->space(); @@ -170,7 +170,7 @@ $allow_named = false; $allow_indexed = true; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context); +$res = $script->run($context); ?> --EXPECT-- diff --git a/tests/V8ObjectTemplate_SetNativeDataProperty.phpt b/tests/V8ObjectTemplate_setNativeDataProperty.phpt similarity index 68% rename from tests/V8ObjectTemplate_SetNativeDataProperty.phpt rename to tests/V8ObjectTemplate_setNativeDataProperty.phpt index 99d92f4..b82ce5e 100644 --- a/tests/V8ObjectTemplate_SetNativeDataProperty.phpt +++ b/tests/V8ObjectTemplate_setNativeDataProperty.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectTemplate::SetNativeDataProperty +V8\ObjectTemplate::setNativeDataProperty() --SKIPIF-- ToString($info->GetContext())->Value(), ' called, value is ', $prop_value, PHP_EOL; + echo 'Userland native getter on property ', $property->toString($info->getContext())->value(), ' called, value is ', $prop_value, PHP_EOL; - $info->GetReturnValue()->Set(new \V8\StringValue($info->GetIsolate(), $prop_value)); + $info->getReturnValue()->set(new \V8\StringValue($info->getIsolate(), $prop_value)); }; $setter = function (\V8\NameValue $property, \V8\Value $value, \V8\PropertyCallbackInfo $info) use (& $prop_value) { - $val = $value->ToString($info->GetContext())->Value(); - echo 'Userland native setter on property ', $property->ToString($info->GetContext())->Value(), ' called with ', $val, ', value is ', $prop_value, PHP_EOL; + $val = $value->toString($info->getContext())->value(); + echo 'Userland native setter on property ', $property->toString($info->getContext())->value(), ' called with ', $val, ', value is ', $prop_value, PHP_EOL; $prop_value = $val; }; $tpl = new V8\ObjectTemplate($isolate); -$tpl->SetNativeDataProperty(new \V8\StringValue($isolate, 'test'), $getter, $setter); +$tpl->setNativeDataProperty(new \V8\StringValue($isolate, 'test'), $getter, $setter); $context = new V8\Context($isolate); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'obj'), $tpl->NewInstance($context)); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'obj'), $tpl->newInstance($context)); $v8_helper->injectConsoleLog($context); diff --git a/tests/V8ObjectValue.phpt b/tests/V8ObjectValue.phpt index 7096246..ba6bb92 100644 --- a/tests/V8ObjectValue.phpt +++ b/tests/V8ObjectValue.phpt @@ -26,22 +26,22 @@ $helper->space(); $helper->assert('ObjectValue extends Value', $value instanceof \V8\Value); $helper->assert('ObjectValue does not extend PrimitiveValue', !($value instanceof \V8\PrimitiveValue)); $helper->assert('ObjectValue implements AdjustableExternalMemoryInterface', $value instanceof \V8\AdjustableExternalMemoryInterface); -$helper->assert('ObjectValue is instanceof Object', $value->InstanceOf($context, $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'Object')))); +$helper->assert('ObjectValue is instanceof Object', $value->instanceOf($context, $context->globalObject()->get($context, new \V8\StringValue($isolate, 'Object')))); $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_matches($value, 'GetContext', $context); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_matches($value, 'getContext', $context); $helper->space(); $helper->header('Getters'); -$helper->assert('GetIdentityHash is integer', gettype($value->GetIdentityHash()), 'integer'); +$helper->assert('GetIdentityHash is integer', gettype($value->getIdentityHash()), 'integer'); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); $helper->header('Converters'); -$helper->dump_object_methods($value, ['@@default' => [$context]], new RegexpFilter('/^To/')); +$helper->dump_object_methods($value, ['@@default' => [$context]], new RegexpFilter('/^to/')); ?> --EXPECT-- @@ -67,8 +67,8 @@ ObjectValue is instanceof Object: ok Accessors: ---------- -V8\ObjectValue::GetIsolate() matches expected value -V8\ObjectValue::GetContext() matches expected value +V8\ObjectValue::getIsolate() matches expected value +V8\ObjectValue::getContext() matches expected value Getters: @@ -78,87 +78,87 @@ GetIdentityHash is integer: ok Checkers: --------- -V8\ObjectValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\ObjectValue->IsCallable(): bool(false) -V8\ObjectValue->IsConstructor(): bool(false) -V8\ObjectValue(V8\Value)->IsUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsNull(): bool(false) -V8\ObjectValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\ObjectValue(V8\Value)->IsTrue(): bool(false) -V8\ObjectValue(V8\Value)->IsFalse(): bool(false) -V8\ObjectValue(V8\Value)->IsName(): bool(false) -V8\ObjectValue(V8\Value)->IsString(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbol(): bool(false) -V8\ObjectValue(V8\Value)->IsFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsArray(): bool(false) -V8\ObjectValue(V8\Value)->IsObject(): bool(true) -V8\ObjectValue(V8\Value)->IsBoolean(): bool(false) -V8\ObjectValue(V8\Value)->IsNumber(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32(): bool(false) -V8\ObjectValue(V8\Value)->IsDate(): bool(false) -V8\ObjectValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\ObjectValue(V8\Value)->IsBooleanObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNumberObject(): bool(false) -V8\ObjectValue(V8\Value)->IsStringObject(): bool(false) -V8\ObjectValue(V8\Value)->IsSymbolObject(): bool(false) -V8\ObjectValue(V8\Value)->IsNativeError(): bool(false) -V8\ObjectValue(V8\Value)->IsRegExp(): bool(false) -V8\ObjectValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\ObjectValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\ObjectValue(V8\Value)->IsPromise(): bool(false) -V8\ObjectValue(V8\Value)->IsMap(): bool(false) -V8\ObjectValue(V8\Value)->IsSet(): bool(false) -V8\ObjectValue(V8\Value)->IsMapIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsSetIterator(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakMap(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakSet(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\ObjectValue(V8\Value)->IsTypedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\ObjectValue(V8\Value)->IsInt8Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt16Array(): bool(false) -V8\ObjectValue(V8\Value)->IsUint32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsInt32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat32Array(): bool(false) -V8\ObjectValue(V8\Value)->IsFloat64Array(): bool(false) -V8\ObjectValue(V8\Value)->IsDataView(): bool(false) -V8\ObjectValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\ObjectValue(V8\Value)->IsProxy(): bool(false) +V8\ObjectValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\ObjectValue->isCallable(): bool(false) +V8\ObjectValue->isConstructor(): bool(false) +V8\ObjectValue(V8\Value)->isUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isNull(): bool(false) +V8\ObjectValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\ObjectValue(V8\Value)->isTrue(): bool(false) +V8\ObjectValue(V8\Value)->isFalse(): bool(false) +V8\ObjectValue(V8\Value)->isName(): bool(false) +V8\ObjectValue(V8\Value)->isString(): bool(false) +V8\ObjectValue(V8\Value)->isSymbol(): bool(false) +V8\ObjectValue(V8\Value)->isFunction(): bool(false) +V8\ObjectValue(V8\Value)->isArray(): bool(false) +V8\ObjectValue(V8\Value)->isObject(): bool(true) +V8\ObjectValue(V8\Value)->isBoolean(): bool(false) +V8\ObjectValue(V8\Value)->isNumber(): bool(false) +V8\ObjectValue(V8\Value)->isInt32(): bool(false) +V8\ObjectValue(V8\Value)->isUint32(): bool(false) +V8\ObjectValue(V8\Value)->isDate(): bool(false) +V8\ObjectValue(V8\Value)->isArgumentsObject(): bool(false) +V8\ObjectValue(V8\Value)->isBooleanObject(): bool(false) +V8\ObjectValue(V8\Value)->isNumberObject(): bool(false) +V8\ObjectValue(V8\Value)->isStringObject(): bool(false) +V8\ObjectValue(V8\Value)->isSymbolObject(): bool(false) +V8\ObjectValue(V8\Value)->isNativeError(): bool(false) +V8\ObjectValue(V8\Value)->isRegExp(): bool(false) +V8\ObjectValue(V8\Value)->isAsyncFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\ObjectValue(V8\Value)->isGeneratorObject(): bool(false) +V8\ObjectValue(V8\Value)->isPromise(): bool(false) +V8\ObjectValue(V8\Value)->isMap(): bool(false) +V8\ObjectValue(V8\Value)->isSet(): bool(false) +V8\ObjectValue(V8\Value)->isMapIterator(): bool(false) +V8\ObjectValue(V8\Value)->isSetIterator(): bool(false) +V8\ObjectValue(V8\Value)->isWeakMap(): bool(false) +V8\ObjectValue(V8\Value)->isWeakSet(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isArrayBufferView(): bool(false) +V8\ObjectValue(V8\Value)->isTypedArray(): bool(false) +V8\ObjectValue(V8\Value)->isUint8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\ObjectValue(V8\Value)->isInt8Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint16Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt16Array(): bool(false) +V8\ObjectValue(V8\Value)->isUint32Array(): bool(false) +V8\ObjectValue(V8\Value)->isInt32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat32Array(): bool(false) +V8\ObjectValue(V8\Value)->isFloat64Array(): bool(false) +V8\ObjectValue(V8\Value)->isDataView(): bool(false) +V8\ObjectValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\ObjectValue(V8\Value)->isProxy(): bool(false) Converters: ----------- -V8\ObjectValue(V8\Value)->ToBoolean(): +V8\ObjectValue(V8\Value)->toBoolean(): object(V8\BooleanValue)#117 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ObjectValue(V8\Value)->ToNumber(): +V8\ObjectValue(V8\Value)->toNumber(): object(V8\NumberValue)#117 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ObjectValue(V8\Value)->ToString(): +V8\ObjectValue(V8\Value)->toString(): object(V8\StringValue)#117 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ObjectValue(V8\Value)->ToDetailString(): +V8\ObjectValue(V8\Value)->toDetailString(): object(V8\StringValue)#117 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ObjectValue(V8\Value)->ToObject(): +V8\ObjectValue(V8\Value)->toObject(): object(V8\ObjectValue)#6 (2) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { @@ -170,22 +170,22 @@ V8\ObjectValue(V8\Value)->ToObject(): } } } -V8\ObjectValue(V8\Value)->ToInteger(): +V8\ObjectValue(V8\Value)->toInteger(): object(V8\Int32Value)#117 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ObjectValue(V8\Value)->ToUint32(): +V8\ObjectValue(V8\Value)->toUint32(): object(V8\Int32Value)#117 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ObjectValue(V8\Value)->ToInt32(): +V8\ObjectValue(V8\Value)->toInt32(): object(V8\Int32Value)#117 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\ObjectValue(V8\Value)->ToArrayIndex(): V8\Exceptions\Exception: Failed to convert +V8\ObjectValue(V8\Value)->toArrayIndex(): V8\Exceptions\Exception: Failed to convert diff --git a/tests/V8ObjectValue_Get.phpt b/tests/V8ObjectValue_get.phpt similarity index 67% rename from tests/V8ObjectValue_Get.phpt rename to tests/V8ObjectValue_get.phpt index fc33004..077b77a 100644 --- a/tests/V8ObjectValue_Get.phpt +++ b/tests/V8ObjectValue_get.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectValue::Get +V8\ObjectValue::get() --SKIPIF-- --FILE-- @@ -16,15 +16,15 @@ $context = new V8\Context($isolate, $global_template); $fnc = new \V8\FunctionObject($context, function () {echo 'I am fun', PHP_EOL;}); $object = new V8\ObjectValue($context); -$object->Set($context, new \V8\StringValue($isolate, 'scalar'), new \V8\StringValue($isolate, 'test')); -$object->Set($context, new \V8\StringValue($isolate, 'func'), $fnc); +$object->set($context, new \V8\StringValue($isolate, 'scalar'), new \V8\StringValue($isolate, 'test')); +$object->set($context, new \V8\StringValue($isolate, 'func'), $fnc); -$helper->value_instanceof($object->Get($context, new \V8\StringValue($isolate, 'scalar')), '\V8\StringValue'); -$helper->value_instanceof($object->Get($context, new \V8\StringValue($isolate, 'func')), '\V8\FunctionObject'); +$helper->value_instanceof($object->get($context, new \V8\StringValue($isolate, 'scalar')), '\V8\StringValue'); +$helper->value_instanceof($object->get($context, new \V8\StringValue($isolate, 'func')), '\V8\FunctionObject'); -$f1 = $object->Get($context, new \V8\StringValue($isolate, 'func')); -$f2 = $object->Get($context, new \V8\StringValue($isolate, 'func')); +$f1 = $object->get($context, new \V8\StringValue($isolate, 'func')); +$f2 = $object->get($context, new \V8\StringValue($isolate, 'func')); $helper->value_matches_with_no_output($fnc, $f1); $helper->value_matches_with_no_output($f1, $f2); diff --git a/tests/V8ObjectValue_IsArgumentsObject.phpt b/tests/V8ObjectValue_isArgumentsObject.phpt similarity index 63% rename from tests/V8ObjectValue_IsArgumentsObject.phpt rename to tests/V8ObjectValue_isArgumentsObject.phpt index c31940d..a55d984 100644 --- a/tests/V8ObjectValue_IsArgumentsObject.phpt +++ b/tests/V8ObjectValue_isArgumentsObject.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectValue::IsArgumentsObject() +V8\ObjectValue::isArgumentsObject() --SKIPIF-- arguments_object = CompileRun("var out = 0; (function(){ out = arguments; })(1,2,3); out;"); $arguments_object = $v8_helper->CompileRun($context, "var out = 0; (function(){ out = arguments; })(1,2,3); out;"); -// CHECK(arguments_object->IsArgumentsObject()); -$v8_helper->CHECK($arguments_object->IsArgumentsObject(), '$arguments_object->IsArgumentsObject()'); +// CHECK(arguments_object->isArgumentsObject()); +$v8_helper->CHECK($arguments_object->isArgumentsObject(), '$arguments_object->isArgumentsObject()'); // v8::Handle array = CompileRun("[1,2,3]"); $array = $v8_helper->CompileRun($context, "[1,2,3]"); -// CHECK(!array->IsArgumentsObject()); -$v8_helper->CHECK(!$array->IsArgumentsObject(), '!$array->IsArgumentsObject()'); +// CHECK(!array->isArgumentsObject()); +$v8_helper->CHECK(!$array->isArgumentsObject(), '!$array->isArgumentsObject()'); // v8::Handle object = CompileRun("{a:42}"); $object = $v8_helper->CompileRun($context, "{a:42}"); -// CHECK(!object->IsArgumentsObject()); -$v8_helper->CHECK(!$object->IsArgumentsObject(), '!$object->IsArgumentsObject()'); +// CHECK(!object->isArgumentsObject()); +$v8_helper->CHECK(!$object->isArgumentsObject(), '!$object->isArgumentsObject()'); ?> --EXPECT-- -CHECK $arguments_object->IsArgumentsObject(): OK -CHECK !$array->IsArgumentsObject(): OK -CHECK !$object->IsArgumentsObject(): OK +CHECK $arguments_object->isArgumentsObject(): OK +CHECK !$array->isArgumentsObject(): OK +CHECK !$object->isArgumentsObject(): OK diff --git a/tests/V8ObjectValue_IsNativeError.phpt b/tests/V8ObjectValue_isNativeError.phpt similarity index 63% rename from tests/V8ObjectValue_IsNativeError.phpt rename to tests/V8ObjectValue_isNativeError.phpt index 9456701..5269897 100644 --- a/tests/V8ObjectValue_IsNativeError.phpt +++ b/tests/V8ObjectValue_isNativeError.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectValue::IsNativeError() +V8\ObjectValue::isNativeError() --SKIPIF-- syntax_error = CompileRun("var out = 0; try { eval(\"#\"); } catch(x) { out = x; } out; "); $syntax_error = $v8_helper->CompileRun($context, "var out = 0; try { eval(\"#\"); } catch(x) { out = x; } out; "); -// CHECK(syntax_error->IsNativeError()); +// CHECK(syntax_error->isNativeError()); -$v8_helper->CHECK($syntax_error->IsNativeError(), '$syntax_error->IsNativeError()'); +$v8_helper->CHECK($syntax_error->isNativeError(), '$syntax_error->isNativeError()'); // v8::Handle not_error = CompileRun("{a:42}"); $not_error = $v8_helper->CompileRun($context, "{a:42}"); -// CHECK(!not_error->IsNativeError()); -$v8_helper->CHECK(!$not_error->IsNativeError(), '!$not_error->IsNativeError()'); +// CHECK(!not_error->isNativeError()); +$v8_helper->CHECK(!$not_error->isNativeError(), '!$not_error->isNativeError()'); // v8::Handle not_object = CompileRun("42"); $not_object = $v8_helper->CompileRun($context, "42"); -// CHECK(!not_object->IsNativeError()); -$v8_helper->CHECK(!$not_object->IsNativeError(), '!$not_object->IsNativeError()'); +// CHECK(!not_object->isNativeError()); +$v8_helper->CHECK(!$not_object->isNativeError(), '!$not_object->isNativeError()'); ?> --EXPECT-- -CHECK $syntax_error->IsNativeError(): OK -CHECK !$not_error->IsNativeError(): OK -CHECK !$not_object->IsNativeError(): OK +CHECK $syntax_error->isNativeError(): OK +CHECK !$not_error->isNativeError(): OK +CHECK !$not_object->isNativeError(): OK diff --git a/tests/V8ObjectValue_SetAccessor.phpt b/tests/V8ObjectValue_setAccessor.phpt similarity index 62% rename from tests/V8ObjectValue_SetAccessor.phpt rename to tests/V8ObjectValue_setAccessor.phpt index 7c46ce1..30105a4 100644 --- a/tests/V8ObjectValue_SetAccessor.phpt +++ b/tests/V8ObjectValue_setAccessor.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectValue::SetAccessor +V8\ObjectValue::setAccessor() --SKIPIF-- GetContext(); + $context = $info->getContext(); $out = []; - foreach ($info->Arguments() as $arg) { - if ($arg->IsUndefined()) { + foreach ($info->arguments() as $arg) { + if ($arg->isUndefined()) { $out[] = ''; - } elseif ($arg->IsNull()) { + } elseif ($arg->isNull()) { $out[] = var_export(null, true); - } elseif ($arg->IsTrue() || $arg->IsFalse()) { - $out[] = var_export($arg->BooleanValue($context), true); + } elseif ($arg->isTrue() || $arg->isFalse()) { + $out[] = var_export($arg->booleanValue($context), true); } else { - $out[] = $arg->ToString($context)->Value(); + $out[] = $arg->toString($context)->value(); } } echo implode('', $out), PHP_EOL; }); -$global_template->Set(new \V8\StringValue($isolate, 'print'), $print_func_tpl, \V8\PropertyAttribute::DontDelete); +$global_template->set(new \V8\StringValue($isolate, 'print'), $print_func_tpl, \V8\PropertyAttribute::DontDelete); $context = new V8\Context($isolate, $global_template); $prop_value = 'foo'; $getter = function (\V8\NameValue $property, \V8\PropertyCallbackInfo $info) use (&$prop_value) { - echo 'Userland getter on property ', $property->ToString($info->GetContext())->Value(), ' called, value is ', $prop_value, PHP_EOL; + echo 'Userland getter on property ', $property->toString($info->getContext())->value(), ' called, value is ', $prop_value, PHP_EOL; - $info->GetReturnValue()->Set(new \V8\StringValue($info->GetIsolate(), $prop_value)); + $info->getReturnValue()->set(new \V8\StringValue($info->getIsolate(), $prop_value)); }; $setter = function (\V8\NameValue $property, \V8\Value $value, \V8\PropertyCallbackInfo $info) use (& $prop_value) { - $val = $value->ToString($info->GetContext())->Value(); - echo 'Userland setter on property ', $property->ToString($info->GetContext())->Value(), ' called with ', $val, ', value is ', $prop_value, PHP_EOL; + $val = $value->toString($info->getContext())->value(); + echo 'Userland setter on property ', $property->toString($info->getContext())->value(), ' called with ', $val, ', value is ', $prop_value, PHP_EOL; $prop_value = $val; }; @@ -62,9 +62,9 @@ $setter = function (\V8\NameValue $property, \V8\Value $value, \V8\PropertyCallb $obj = new \V8\ObjectValue($context); -$obj->SetAccessor($context, new \V8\StringValue($isolate, 'test'), $getter, $setter); +$obj->setAccessor($context, new \V8\StringValue($isolate, 'test'), $getter, $setter); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'obj'), $obj); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'obj'), $obj); $source = ' print(obj.test); obj.test = "bar"; @@ -77,7 +77,7 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$helper->dump($script->Run($context)->ToString($context)->Value()); +$helper->dump($script->run($context)->toString($context)->value()); ?> --EXPECT-- diff --git a/tests/V8ObjectValue_SetIntegrityLevel.phpt b/tests/V8ObjectValue_setIntegrityLevel.phpt similarity index 74% rename from tests/V8ObjectValue_SetIntegrityLevel.phpt rename to tests/V8ObjectValue_setIntegrityLevel.phpt index 097c6ec..3c81379 100644 --- a/tests/V8ObjectValue_SetIntegrityLevel.phpt +++ b/tests/V8ObjectValue_setIntegrityLevel.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectValue::SetIntegrityLevel() +V8\ObjectValue::setIntegrityLevel() --SKIPIF-- --FILE-- @@ -19,18 +19,18 @@ $v8_helper->injectConsoleLog($context); $obj0 = new \V8\ObjectValue($context); -$obj0->Set($context, new \V8\StringValue($isolate, 'test'), new \V8\IntegerValue($isolate, 42)); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'obj0'), $obj0); +$obj0->set($context, new \V8\StringValue($isolate, 'test'), new \V8\IntegerValue($isolate, 42)); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'obj0'), $obj0); $obj1 = new \V8\ObjectValue($context); -$obj1->Set($context, new \V8\StringValue($isolate, 'test'), new \V8\IntegerValue($isolate, 42)); -$obj1->SetIntegrityLevel($context, \V8\IntegrityLevel::kFrozen); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'obj1'), $obj1); +$obj1->set($context, new \V8\StringValue($isolate, 'test'), new \V8\IntegerValue($isolate, 42)); +$obj1->setIntegrityLevel($context, \V8\IntegrityLevel::kFrozen); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'obj1'), $obj1); $obj2 = new \V8\ObjectValue($context); -$obj2->Set($context, new \V8\StringValue($isolate, 'test'), new \V8\IntegerValue($isolate, 42)); -$obj2->SetIntegrityLevel($context, \V8\IntegrityLevel::kSealed); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'obj2'), $obj2); +$obj2->set($context, new \V8\StringValue($isolate, 'test'), new \V8\IntegerValue($isolate, 42)); +$obj2->setIntegrityLevel($context, \V8\IntegrityLevel::kSealed); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'obj2'), $obj2); $source = ' console.log(Object.isFrozen(obj0)); @@ -71,7 +71,7 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$script->Run($context); +$script->run($context); ?> --EXPECT-- diff --git a/tests/V8ObjectValue_SetNativeDataProperty.phpt b/tests/V8ObjectValue_setNativeDataProperty.phpt similarity index 71% rename from tests/V8ObjectValue_SetNativeDataProperty.phpt rename to tests/V8ObjectValue_setNativeDataProperty.phpt index 529b278..1ba7e68 100644 --- a/tests/V8ObjectValue_SetNativeDataProperty.phpt +++ b/tests/V8ObjectValue_setNativeDataProperty.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectValue::SetNativeDataProperty +V8\ObjectValue::setNativeDataProperty() --SKIPIF-- ToString($info->GetContext())->Value(), ' called, value is ', $prop_value, PHP_EOL; + echo 'Userland native getter on property ', $property->toString($info->getContext())->value(), ' called, value is ', $prop_value, PHP_EOL; - $info->GetReturnValue()->Set(new \V8\StringValue($info->GetIsolate(), $prop_value)); + $info->getReturnValue()->set(new \V8\StringValue($info->getIsolate(), $prop_value)); }; $setter = function (\V8\NameValue $property, \V8\Value $value, \V8\PropertyCallbackInfo $info) use (& $prop_value) { - $val = $value->ToString($info->GetContext())->Value(); - echo 'Userland native setter on property ', $property->ToString($info->GetContext())->Value(), ' called with ', $val, ', value is ', $prop_value, PHP_EOL; + $val = $value->toString($info->getContext())->value(); + echo 'Userland native setter on property ', $property->toString($info->getContext())->value(), ' called with ', $val, ', value is ', $prop_value, PHP_EOL; $prop_value = $val; }; @@ -36,9 +36,9 @@ $setter = function (\V8\NameValue $property, \V8\Value $value, \V8\PropertyCallb $context = new V8\Context($isolate); $obj = new V8\ObjectValue($context); -$obj->SetNativeDataProperty($context, new \V8\StringValue($isolate, 'test'), $getter, $setter); +$obj->setNativeDataProperty($context, new \V8\StringValue($isolate, 'test'), $getter, $setter); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'obj'), $obj); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'obj'), $obj); $v8_helper->injectConsoleLog($context); diff --git a/tests/V8ObjectValue_SetNativeDataProperty_from_template.phpt b/tests/V8ObjectValue_setNativeDataProperty_from_template.phpt similarity index 72% rename from tests/V8ObjectValue_SetNativeDataProperty_from_template.phpt rename to tests/V8ObjectValue_setNativeDataProperty_from_template.phpt index ba7008c..03a2a3e 100644 --- a/tests/V8ObjectValue_SetNativeDataProperty_from_template.phpt +++ b/tests/V8ObjectValue_setNativeDataProperty_from_template.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ObjectValue::SetNativeDataProperty - when object created from template +V8\ObjectValue::setNativeDataProperty - when object created from template --SKIPIF-- ToString($info->GetContext())->Value(), ' called, value is ', $prop_value, PHP_EOL; + echo 'Userland native getter on property (obj) ', $property->toString($info->getContext())->value(), ' called, value is ', $prop_value, PHP_EOL; - $info->GetReturnValue()->Set(new \V8\StringValue($info->GetIsolate(), $prop_value)); + $info->getReturnValue()->set(new \V8\StringValue($info->getIsolate(), $prop_value)); }; $setter_obj = function (\V8\NameValue $property, \V8\Value $value, \V8\PropertyCallbackInfo $info) use (& $prop_value) { - $val = $value->ToString($info->GetContext())->Value(); - echo 'Userland native setter on property (obj) ', $property->ToString($info->GetContext())->Value(), ' called with ', $val, ', value is ', $prop_value, PHP_EOL; + $val = $value->toString($info->getContext())->value(); + echo 'Userland native setter on property (obj) ', $property->toString($info->getContext())->value(), ' called with ', $val, ', value is ', $prop_value, PHP_EOL; $prop_value = $val; }; $getter_tpl = function (\V8\NameValue $property, \V8\PropertyCallbackInfo $info) use (&$prop_value) { - echo 'Userland native getter on property (tpl) ', $property->ToString($info->GetContext())->Value(), ' called, value is ', $prop_value, PHP_EOL; + echo 'Userland native getter on property (tpl) ', $property->toString($info->getContext())->value(), ' called, value is ', $prop_value, PHP_EOL; - $info->GetReturnValue()->Set(new \V8\StringValue($info->GetIsolate(), $prop_value)); + $info->getReturnValue()->set(new \V8\StringValue($info->getIsolate(), $prop_value)); }; $setter_tpl = function (\V8\NameValue $property, \V8\Value $value, \V8\PropertyCallbackInfo $info) use (& $prop_value) { - $val = $value->ToString($info->GetContext())->Value(); - echo 'Userland native setter on property (tpl) ', $property->ToString($info->GetContext())->Value(), ' called with ', $val, ', value is ', $prop_value, PHP_EOL; + $val = $value->toString($info->getContext())->value(); + echo 'Userland native setter on property (tpl) ', $property->toString($info->getContext())->value(), ' called with ', $val, ', value is ', $prop_value, PHP_EOL; $prop_value = $val; }; $context = new V8\Context($isolate); $tpl = new V8\ObjectTemplate($isolate); -$tpl->SetNativeDataProperty(new \V8\StringValue($isolate, 'test'), $getter_tpl, $setter_tpl); +$tpl->setNativeDataProperty(new \V8\StringValue($isolate, 'test'), $getter_tpl, $setter_tpl); $obj = new V8\ObjectValue($context); -$obj->SetNativeDataProperty($context, new \V8\StringValue($isolate, 'test'), $getter_obj, $setter_obj); +$obj->setNativeDataProperty($context, new \V8\StringValue($isolate, 'test'), $getter_obj, $setter_obj); -$obj1 = $tpl->NewInstance($context); -$obj1->SetNativeDataProperty($context, new \V8\StringValue($isolate, 'test'), $getter_obj, $setter_obj); +$obj1 = $tpl->newInstance($context); +$obj1->setNativeDataProperty($context, new \V8\StringValue($isolate, 'test'), $getter_obj, $setter_obj); -$obj2 = $tpl->NewInstance($context); +$obj2 = $tpl->newInstance($context); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'obj'), $obj); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'obj1'), $obj1); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'obj2'), $obj2); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'obj'), $obj); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'obj1'), $obj1); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'obj2'), $obj2); $v8_helper->injectConsoleLog($context); diff --git a/tests/V8PropertyCallbackInfo.phpt b/tests/V8PropertyCallbackInfo.phpt index a773755..cf4b945 100644 --- a/tests/V8PropertyCallbackInfo.phpt +++ b/tests/V8PropertyCallbackInfo.phpt @@ -31,25 +31,25 @@ $getter = function (NameValue $property, PropertyCallbackInfo $info) use (&$prop $helper->dump($info); $helper->space(); - $helper->assert('Callback info holds original isolate object', $info->GetIsolate(), $isolate); - $helper->assert('Callback info holds original isolate object', $info->GetContext(), $context); + $helper->assert('Callback info holds original isolate object', $info->getIsolate(), $isolate); + $helper->assert('Callback info holds original isolate object', $info->getContext(), $context); $helper->space(); - $info->GetReturnValue()->Set(new StringValue($info->GetIsolate(), $prop_value)); + $info->getReturnValue()->set(new StringValue($info->getIsolate(), $prop_value)); }; $obj = new ObjectValue($context); -$obj->SetAccessor($context, new StringValue($isolate, 'test'), $getter); +$obj->setAccessor($context, new StringValue($isolate, 'test'), $getter); -$context->GlobalObject()->Set($context, new StringValue($isolate, 'obj'), $obj); +$context->globalObject()->set($context, new StringValue($isolate, 'obj'), $obj); $script = new Script($context, new StringValue($isolate, 'obj.test')); -$helper->dump($script->Run($context)->ToString($context)->Value()); +$helper->dump($script->run($context)->toString($context)->value()); ?> --EXPECT-- diff --git a/tests/V8RegExpObject.phpt b/tests/V8RegExpObject.phpt index 333aa7a..be95a9e 100644 --- a/tests/V8RegExpObject.phpt +++ b/tests/V8RegExpObject.phpt @@ -27,13 +27,13 @@ $helper->assert('RegExpObject extends ObjectValue', $value instanceof \V8\Object $helper->line(); $helper->header('Getters'); -$helper->pretty_dump(get_class($value) . '->GetSource()->Value()', $value->GetSource()->Value()); -$helper->method_export($value, 'GetFlags'); +$helper->pretty_dump(get_class($value) . '->getSource()->value()', $value->getSource()->value()); +$helper->method_export($value, 'getFlags'); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'val'), $value); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'val'), $value); $source = ' console.log("val: ", val); @@ -45,7 +45,7 @@ val $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context); +$res = $script->run($context); $helper->space(); @@ -75,64 +75,64 @@ RegExpObject extends ObjectValue: ok Getters: -------- -V8\RegExpObject->GetSource()->Value(): string(21) "([a-z]{1,4})-([0-9]+)" -V8\RegExpObject->GetFlags(): int(2) +V8\RegExpObject->getSource()->value(): string(21) "([a-z]{1,4})-([0-9]+)" +V8\RegExpObject->getFlags(): int(2) Checkers: --------- -V8\RegExpObject(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\RegExpObject(V8\ObjectValue)->IsCallable(): bool(false) -V8\RegExpObject(V8\ObjectValue)->IsConstructor(): bool(false) -V8\RegExpObject(V8\Value)->IsUndefined(): bool(false) -V8\RegExpObject(V8\Value)->IsNull(): bool(false) -V8\RegExpObject(V8\Value)->IsNullOrUndefined(): bool(false) -V8\RegExpObject(V8\Value)->IsTrue(): bool(false) -V8\RegExpObject(V8\Value)->IsFalse(): bool(false) -V8\RegExpObject(V8\Value)->IsName(): bool(false) -V8\RegExpObject(V8\Value)->IsString(): bool(false) -V8\RegExpObject(V8\Value)->IsSymbol(): bool(false) -V8\RegExpObject(V8\Value)->IsFunction(): bool(false) -V8\RegExpObject(V8\Value)->IsArray(): bool(false) -V8\RegExpObject(V8\Value)->IsObject(): bool(true) -V8\RegExpObject(V8\Value)->IsBoolean(): bool(false) -V8\RegExpObject(V8\Value)->IsNumber(): bool(false) -V8\RegExpObject(V8\Value)->IsInt32(): bool(false) -V8\RegExpObject(V8\Value)->IsUint32(): bool(false) -V8\RegExpObject(V8\Value)->IsDate(): bool(false) -V8\RegExpObject(V8\Value)->IsArgumentsObject(): bool(false) -V8\RegExpObject(V8\Value)->IsBooleanObject(): bool(false) -V8\RegExpObject(V8\Value)->IsNumberObject(): bool(false) -V8\RegExpObject(V8\Value)->IsStringObject(): bool(false) -V8\RegExpObject(V8\Value)->IsSymbolObject(): bool(false) -V8\RegExpObject(V8\Value)->IsNativeError(): bool(false) -V8\RegExpObject(V8\Value)->IsRegExp(): bool(true) -V8\RegExpObject(V8\Value)->IsAsyncFunction(): bool(false) -V8\RegExpObject(V8\Value)->IsGeneratorFunction(): bool(false) -V8\RegExpObject(V8\Value)->IsGeneratorObject(): bool(false) -V8\RegExpObject(V8\Value)->IsPromise(): bool(false) -V8\RegExpObject(V8\Value)->IsMap(): bool(false) -V8\RegExpObject(V8\Value)->IsSet(): bool(false) -V8\RegExpObject(V8\Value)->IsMapIterator(): bool(false) -V8\RegExpObject(V8\Value)->IsSetIterator(): bool(false) -V8\RegExpObject(V8\Value)->IsWeakMap(): bool(false) -V8\RegExpObject(V8\Value)->IsWeakSet(): bool(false) -V8\RegExpObject(V8\Value)->IsArrayBuffer(): bool(false) -V8\RegExpObject(V8\Value)->IsArrayBufferView(): bool(false) -V8\RegExpObject(V8\Value)->IsTypedArray(): bool(false) -V8\RegExpObject(V8\Value)->IsUint8Array(): bool(false) -V8\RegExpObject(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\RegExpObject(V8\Value)->IsInt8Array(): bool(false) -V8\RegExpObject(V8\Value)->IsUint16Array(): bool(false) -V8\RegExpObject(V8\Value)->IsInt16Array(): bool(false) -V8\RegExpObject(V8\Value)->IsUint32Array(): bool(false) -V8\RegExpObject(V8\Value)->IsInt32Array(): bool(false) -V8\RegExpObject(V8\Value)->IsFloat32Array(): bool(false) -V8\RegExpObject(V8\Value)->IsFloat64Array(): bool(false) -V8\RegExpObject(V8\Value)->IsDataView(): bool(false) -V8\RegExpObject(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\RegExpObject(V8\Value)->IsProxy(): bool(false) +V8\RegExpObject(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\RegExpObject(V8\ObjectValue)->isCallable(): bool(false) +V8\RegExpObject(V8\ObjectValue)->isConstructor(): bool(false) +V8\RegExpObject(V8\Value)->isUndefined(): bool(false) +V8\RegExpObject(V8\Value)->isNull(): bool(false) +V8\RegExpObject(V8\Value)->isNullOrUndefined(): bool(false) +V8\RegExpObject(V8\Value)->isTrue(): bool(false) +V8\RegExpObject(V8\Value)->isFalse(): bool(false) +V8\RegExpObject(V8\Value)->isName(): bool(false) +V8\RegExpObject(V8\Value)->isString(): bool(false) +V8\RegExpObject(V8\Value)->isSymbol(): bool(false) +V8\RegExpObject(V8\Value)->isFunction(): bool(false) +V8\RegExpObject(V8\Value)->isArray(): bool(false) +V8\RegExpObject(V8\Value)->isObject(): bool(true) +V8\RegExpObject(V8\Value)->isBoolean(): bool(false) +V8\RegExpObject(V8\Value)->isNumber(): bool(false) +V8\RegExpObject(V8\Value)->isInt32(): bool(false) +V8\RegExpObject(V8\Value)->isUint32(): bool(false) +V8\RegExpObject(V8\Value)->isDate(): bool(false) +V8\RegExpObject(V8\Value)->isArgumentsObject(): bool(false) +V8\RegExpObject(V8\Value)->isBooleanObject(): bool(false) +V8\RegExpObject(V8\Value)->isNumberObject(): bool(false) +V8\RegExpObject(V8\Value)->isStringObject(): bool(false) +V8\RegExpObject(V8\Value)->isSymbolObject(): bool(false) +V8\RegExpObject(V8\Value)->isNativeError(): bool(false) +V8\RegExpObject(V8\Value)->isRegExp(): bool(true) +V8\RegExpObject(V8\Value)->isAsyncFunction(): bool(false) +V8\RegExpObject(V8\Value)->isGeneratorFunction(): bool(false) +V8\RegExpObject(V8\Value)->isGeneratorObject(): bool(false) +V8\RegExpObject(V8\Value)->isPromise(): bool(false) +V8\RegExpObject(V8\Value)->isMap(): bool(false) +V8\RegExpObject(V8\Value)->isSet(): bool(false) +V8\RegExpObject(V8\Value)->isMapIterator(): bool(false) +V8\RegExpObject(V8\Value)->isSetIterator(): bool(false) +V8\RegExpObject(V8\Value)->isWeakMap(): bool(false) +V8\RegExpObject(V8\Value)->isWeakSet(): bool(false) +V8\RegExpObject(V8\Value)->isArrayBuffer(): bool(false) +V8\RegExpObject(V8\Value)->isArrayBufferView(): bool(false) +V8\RegExpObject(V8\Value)->isTypedArray(): bool(false) +V8\RegExpObject(V8\Value)->isUint8Array(): bool(false) +V8\RegExpObject(V8\Value)->isUint8ClampedArray(): bool(false) +V8\RegExpObject(V8\Value)->isInt8Array(): bool(false) +V8\RegExpObject(V8\Value)->isUint16Array(): bool(false) +V8\RegExpObject(V8\Value)->isInt16Array(): bool(false) +V8\RegExpObject(V8\Value)->isUint32Array(): bool(false) +V8\RegExpObject(V8\Value)->isInt32Array(): bool(false) +V8\RegExpObject(V8\Value)->isFloat32Array(): bool(false) +V8\RegExpObject(V8\Value)->isFloat64Array(): bool(false) +V8\RegExpObject(V8\Value)->isDataView(): bool(false) +V8\RegExpObject(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\RegExpObject(V8\Value)->isProxy(): bool(false) val: /([a-z]{1,4})-([0-9]+)/i diff --git a/tests/V8ReturnValue.phpt b/tests/V8ReturnValue.phpt index aaaf12c..ebd34b6 100644 --- a/tests/V8ReturnValue.phpt +++ b/tests/V8ReturnValue.phpt @@ -19,7 +19,7 @@ $isolate = new v8Tests\TrackingDtors\Isolate(); $global_template = new V8\ObjectTemplate($isolate); -//$global_template->Set(new \V8\StringValue($isolate, 'print'), $v8_helper->getPrintFunctionTemplate($isolate), \V8\PropertyAttribute::DontDelete); +// $global_template->set(new \V8\StringValue($isolate, 'print'), $v8_helper->getPrintFunctionTemplate($isolate), \V8\PropertyAttribute::DontDelete); $context = new V8\Context($isolate, $global_template); @@ -33,25 +33,25 @@ $args = []; $func = new v8Tests\TrackingDtors\FunctionObject($context, function (\V8\FunctionCallbackInfo $info) use ($helper, $scalar, $object, $isolate, $context, &$method, &$checker, &$args) { - $retval = $info->GetReturnValue(); + $retval = $info->getReturnValue(); if (!$method) { echo 'Function called', PHP_EOL; - $helper->assert('Return value holds original isolate object', $retval->GetIsolate(), $isolate); - $helper->assert('Return value holds original context object', $retval->GetContext(), $context); + $helper->assert('Return value holds original isolate object', $retval->getIsolate(), $isolate); + $helper->assert('Return value holds original context object', $retval->getContext(), $context); } - $helper->assert('Return value holds no value', $retval->Get()->IsUndefined()); + $helper->assert('Return value holds no value', $retval->get()->isUndefined()); if ($method) { $retval->{$method}(...$args); if ($checker) { - $helper->assert('Return value was set and holds proper value', $retval->Get()->{$checker}()); + $helper->assert('Return value was set and holds proper value', $retval->get()->{$checker}()); } } }); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test'), $func); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test'), $func); $source = 'test(); "Script done";'; $file_name = 'test.js'; @@ -59,7 +59,7 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$helper->dump($script->Run($context)->ToString($context)->Value()); +$helper->dump($script->run($context)->toString($context)->value()); $helper->space(); @@ -67,32 +67,32 @@ $method = 'SetUndefined'; $checker = 'IsUndefined'; $args = []; $res = $v8_helper->CompileRun($context, "test()"); -$helper->assert('Returns undefined', $res->IsUndefined()); +$helper->assert('Returns undefined', $res->isUndefined()); $method = 'SetNull'; $checker = 'IsNull'; $args = []; $res = $v8_helper->CompileRun($context, "test()"); -$helper->assert('Returns null', $res->IsNull()); +$helper->assert('Returns null', $res->isNull()); $method = 'SetBool'; $checker = 'IsBoolean'; $args = [true]; $res = $v8_helper->CompileRun($context, "test()"); -$helper->assert('Returns boolean', $res->IsBoolean() && $res->IsTrue()); +$helper->assert('Returns boolean', $res->isBoolean() && $res->isTrue()); $method = 'SetInteger'; $checker = 'IsInt32'; $args = [42]; $res = $v8_helper->CompileRun($context, "test()"); -$helper->assert('Returns integer', $res->IsNumber() && $res->IsInt32()); +$helper->assert('Returns integer', $res->isNumber() && $res->isInt32()); $method = 'SetFloat'; $checker = 'IsNumber'; $args = [PHP_INT_MAX + 0.22]; $res = $v8_helper->CompileRun($context, "test()"); -$helper->assert('Returns float', $res->IsNumber() && !$res->IsInt32() && !$res->IsUint32()); -$helper->pretty_dump('Returns float', $res->Value()); +$helper->assert('Returns float', $res->isNumber() && !$res->isInt32() && !$res->isUint32()); +$helper->pretty_dump('Returns float', $res->value()); $helper->line(); diff --git a/tests/V8ReturnValue_context.phpt b/tests/V8ReturnValue_context.phpt index 9c8cafb..4db60de 100644 --- a/tests/V8ReturnValue_context.phpt +++ b/tests/V8ReturnValue_context.phpt @@ -25,24 +25,24 @@ $retval = null; $func = new V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $info) use ($helper, $isolate, $context, &$retval) { - $retval = $info->GetReturnValue(); + $retval = $info->getReturnValue(); $helper->header('Object representation'); $helper->dump($retval); $helper->space(); - $helper->assert('Return value object is in context', $retval->InContext()); + $helper->assert('Return value object is in context', $retval->inContext()); - $helper->assert('Return value holds original isolate object', $retval->GetIsolate(), $isolate); - $helper->assert('Return value holds original isolate object', $retval->GetContext(), $context); - $helper->assert('Return value holds no value', $retval->Get()->IsUndefined()); + $helper->assert('Return value holds original isolate object', $retval->getIsolate(), $isolate); + $helper->assert('Return value holds original isolate object', $retval->getContext(), $context); + $helper->assert('Return value holds no value', $retval->get()->isUndefined()); - $retval->SetInteger(42); + $retval->setInteger(42); - $helper->inline('Return value holds value', $retval->Get()->Value()); + $helper->inline('Return value holds value', $retval->get()->value()); }); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test'), $func); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test'), $func); $source = 'test(); "Script done";'; $file_name = 'test.js'; @@ -50,13 +50,13 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$script->Run($context); +$script->run($context); $helper->space(); -$helper->assert('Return value object is out of context', false === $retval->InContext()); +$helper->assert('Return value object is out of context', false === $retval->inContext()); try { - $retval->Get(); + $retval->get(); } catch (Exception $e) { $helper->exception_export($e); } diff --git a/tests/V8Script.phpt b/tests/V8Script.phpt index 67e479d..a7ed113 100644 --- a/tests/V8Script.phpt +++ b/tests/V8Script.phpt @@ -20,7 +20,7 @@ $global_template = new V8\ObjectTemplate($isolate); $value = new V8\StringValue($isolate, 'TEST VALUE 111'); -$global_template->Set(new \V8\StringValue($isolate, 'test'), $value); +$global_template->set(new \V8\StringValue($isolate, 'test'), $value); $context = new V8\Context($isolate, $global_template); @@ -34,18 +34,18 @@ $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V $helper->dump($script); $helper->header('Accessors'); -$helper->method_matches($script, 'GetContext', $context); +$helper->method_matches($script, 'getContext', $context); $helper->space(); $helper->header('Get unbound script'); -$helper->method_matches_instanceof($script, 'GetUnboundScript', \V8\UnboundScript::class); -$helper->dump($script->GetUnboundScript()); +$helper->method_matches_instanceof($script, 'getUnboundScript', \V8\UnboundScript::class); +$helper->dump($script->getUnboundScript()); $helper->space(); -$res = $script->Run($context); +$res = $script->run($context); $helper->header('Script result accessors'); -$helper->method_matches($res, 'GetIsolate', $isolate); +$helper->method_matches($res, 'getIsolate', $isolate); $helper->space(); $v8_helper->run_checks($res, 'Checkers'); @@ -64,12 +64,12 @@ object(V8\Script)#7 (2) { } Accessors: ---------- -V8\Script::GetContext() matches expected value +V8\Script::getContext() matches expected value Get unbound script: ------------------- -V8\Script::GetUnboundScript() result is instance of V8\UnboundScript +V8\Script::getUnboundScript() result is instance of V8\UnboundScript object(V8\UnboundScript)#8 (1) { ["isolate":"V8\UnboundScript":private]=> object(V8\Isolate)#3 (0) { @@ -79,59 +79,59 @@ object(V8\UnboundScript)#8 (1) { Script result accessors: ------------------------ -V8\StringValue::GetIsolate() matches expected value +V8\StringValue::getIsolate() matches expected value Checkers: --------- -V8\StringValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "string" - -V8\StringValue->IsOneByte(): bool(true) -V8\StringValue(V8\Value)->IsUndefined(): bool(false) -V8\StringValue(V8\Value)->IsNull(): bool(false) -V8\StringValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\StringValue(V8\Value)->IsTrue(): bool(false) -V8\StringValue(V8\Value)->IsFalse(): bool(false) -V8\StringValue(V8\Value)->IsName(): bool(true) -V8\StringValue(V8\Value)->IsString(): bool(true) -V8\StringValue(V8\Value)->IsSymbol(): bool(false) -V8\StringValue(V8\Value)->IsFunction(): bool(false) -V8\StringValue(V8\Value)->IsArray(): bool(false) -V8\StringValue(V8\Value)->IsObject(): bool(false) -V8\StringValue(V8\Value)->IsBoolean(): bool(false) -V8\StringValue(V8\Value)->IsNumber(): bool(false) -V8\StringValue(V8\Value)->IsInt32(): bool(false) -V8\StringValue(V8\Value)->IsUint32(): bool(false) -V8\StringValue(V8\Value)->IsDate(): bool(false) -V8\StringValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\StringValue(V8\Value)->IsBooleanObject(): bool(false) -V8\StringValue(V8\Value)->IsNumberObject(): bool(false) -V8\StringValue(V8\Value)->IsStringObject(): bool(false) -V8\StringValue(V8\Value)->IsSymbolObject(): bool(false) -V8\StringValue(V8\Value)->IsNativeError(): bool(false) -V8\StringValue(V8\Value)->IsRegExp(): bool(false) -V8\StringValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\StringValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\StringValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\StringValue(V8\Value)->IsPromise(): bool(false) -V8\StringValue(V8\Value)->IsMap(): bool(false) -V8\StringValue(V8\Value)->IsSet(): bool(false) -V8\StringValue(V8\Value)->IsMapIterator(): bool(false) -V8\StringValue(V8\Value)->IsSetIterator(): bool(false) -V8\StringValue(V8\Value)->IsWeakMap(): bool(false) -V8\StringValue(V8\Value)->IsWeakSet(): bool(false) -V8\StringValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\StringValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\StringValue(V8\Value)->IsTypedArray(): bool(false) -V8\StringValue(V8\Value)->IsUint8Array(): bool(false) -V8\StringValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\StringValue(V8\Value)->IsInt8Array(): bool(false) -V8\StringValue(V8\Value)->IsUint16Array(): bool(false) -V8\StringValue(V8\Value)->IsInt16Array(): bool(false) -V8\StringValue(V8\Value)->IsUint32Array(): bool(false) -V8\StringValue(V8\Value)->IsInt32Array(): bool(false) -V8\StringValue(V8\Value)->IsFloat32Array(): bool(false) -V8\StringValue(V8\Value)->IsFloat64Array(): bool(false) -V8\StringValue(V8\Value)->IsDataView(): bool(false) -V8\StringValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\StringValue(V8\Value)->IsProxy(): bool(false) +V8\StringValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "string" + +V8\StringValue->isOneByte(): bool(true) +V8\StringValue(V8\Value)->isUndefined(): bool(false) +V8\StringValue(V8\Value)->isNull(): bool(false) +V8\StringValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\StringValue(V8\Value)->isTrue(): bool(false) +V8\StringValue(V8\Value)->isFalse(): bool(false) +V8\StringValue(V8\Value)->isName(): bool(true) +V8\StringValue(V8\Value)->isString(): bool(true) +V8\StringValue(V8\Value)->isSymbol(): bool(false) +V8\StringValue(V8\Value)->isFunction(): bool(false) +V8\StringValue(V8\Value)->isArray(): bool(false) +V8\StringValue(V8\Value)->isObject(): bool(false) +V8\StringValue(V8\Value)->isBoolean(): bool(false) +V8\StringValue(V8\Value)->isNumber(): bool(false) +V8\StringValue(V8\Value)->isInt32(): bool(false) +V8\StringValue(V8\Value)->isUint32(): bool(false) +V8\StringValue(V8\Value)->isDate(): bool(false) +V8\StringValue(V8\Value)->isArgumentsObject(): bool(false) +V8\StringValue(V8\Value)->isBooleanObject(): bool(false) +V8\StringValue(V8\Value)->isNumberObject(): bool(false) +V8\StringValue(V8\Value)->isStringObject(): bool(false) +V8\StringValue(V8\Value)->isSymbolObject(): bool(false) +V8\StringValue(V8\Value)->isNativeError(): bool(false) +V8\StringValue(V8\Value)->isRegExp(): bool(false) +V8\StringValue(V8\Value)->isAsyncFunction(): bool(false) +V8\StringValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\StringValue(V8\Value)->isGeneratorObject(): bool(false) +V8\StringValue(V8\Value)->isPromise(): bool(false) +V8\StringValue(V8\Value)->isMap(): bool(false) +V8\StringValue(V8\Value)->isSet(): bool(false) +V8\StringValue(V8\Value)->isMapIterator(): bool(false) +V8\StringValue(V8\Value)->isSetIterator(): bool(false) +V8\StringValue(V8\Value)->isWeakMap(): bool(false) +V8\StringValue(V8\Value)->isWeakSet(): bool(false) +V8\StringValue(V8\Value)->isArrayBuffer(): bool(false) +V8\StringValue(V8\Value)->isArrayBufferView(): bool(false) +V8\StringValue(V8\Value)->isTypedArray(): bool(false) +V8\StringValue(V8\Value)->isUint8Array(): bool(false) +V8\StringValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\StringValue(V8\Value)->isInt8Array(): bool(false) +V8\StringValue(V8\Value)->isUint16Array(): bool(false) +V8\StringValue(V8\Value)->isInt16Array(): bool(false) +V8\StringValue(V8\Value)->isUint32Array(): bool(false) +V8\StringValue(V8\Value)->isInt32Array(): bool(false) +V8\StringValue(V8\Value)->isFloat32Array(): bool(false) +V8\StringValue(V8\Value)->isFloat64Array(): bool(false) +V8\StringValue(V8\Value)->isDataView(): bool(false) +V8\StringValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\StringValue(V8\Value)->isProxy(): bool(false) diff --git a/tests/V8ScriptCompiler.phpt b/tests/V8ScriptCompiler.phpt index 4fff87e..424fd8a 100644 --- a/tests/V8ScriptCompiler.phpt +++ b/tests/V8ScriptCompiler.phpt @@ -15,7 +15,7 @@ $v8_helper = new PhpV8Helpers($helper); $isolate = new V8\Isolate(); $helper->header('Methods'); -$helper->inline_dump('V8\ScriptCompiler::CachedDataVersionTag()', V8\ScriptCompiler::CachedDataVersionTag()); +$helper->inline_dump('V8\ScriptCompiler::cachedDataVersionTag()', V8\ScriptCompiler::cachedDataVersionTag()); $helper->space(); @@ -23,4 +23,4 @@ $helper->space(); --EXPECTF-- Methods: -------- -V8\ScriptCompiler::CachedDataVersionTag(): int(%d) +V8\ScriptCompiler::cachedDataVersionTag(): int(%d) diff --git a/tests/V8ScriptCompiler_Compile.phpt b/tests/V8ScriptCompiler_compile.phpt similarity index 73% rename from tests/V8ScriptCompiler_Compile.phpt rename to tests/V8ScriptCompiler_compile.phpt index fc94f40..562a5d9 100644 --- a/tests/V8ScriptCompiler_Compile.phpt +++ b/tests/V8ScriptCompiler_compile.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ScriptCompiler::Compile +V8\ScriptCompiler::compile() --SKIPIF-- --FILE-- @@ -21,21 +21,21 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, '"test"'); $source = new \V8\ScriptCompiler\Source($source_string); - $script = V8\ScriptCompiler::Compile($context, $source); + $script = V8\ScriptCompiler::compile($context, $source); $helper->assert('Compile script', $script instanceof \V8\Script); $source_string = new V8\StringValue($isolate, 'var i = 0; while (true) {i++;}'); $source = new \V8\ScriptCompiler\Source($source_string); - $script = V8\ScriptCompiler::Compile($context, $source); + $script = V8\ScriptCompiler::compile($context, $source); $helper->assert('Compile script', $script instanceof \V8\Script); try { $source_string = new V8\StringValue($isolate, 'garbage garbage garbage'); $source = new \V8\ScriptCompiler\Source($source_string); - $script = V8\ScriptCompiler::Compile($context, $source); + $script = V8\ScriptCompiler::compile($context, $source); } catch (\V8\Exceptions\TryCatchException $e) { $helper->exception_export($e); - //$helper->dump($e->GetTryCatch()); + //$helper->dump($e->getTryCatch()); } try { @@ -43,7 +43,7 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, '"test"'); $source = new \V8\ScriptCompiler\Source($source_string, $origin); - $script = V8\ScriptCompiler::Compile($context, $source); + $script = V8\ScriptCompiler::compile($context, $source); } catch (\V8\Exceptions\Exception $e) { $helper->exception_export($e); } @@ -56,10 +56,10 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, '"test " + status'); $source = new \V8\ScriptCompiler\Source($source_string); - $script = V8\ScriptCompiler::Compile($context, $source); + $script = V8\ScriptCompiler::compile($context, $source); - $context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'status'), new \V8\StringValue($isolate, 'passed')); - $helper->dump($script->Run($context)->Value()); + $context->globalObject()->set($context, new \V8\StringValue($isolate, 'status'), new \V8\StringValue($isolate, 'passed')); + $helper->dump($script->run($context)->value()); $helper->space(); } @@ -69,9 +69,9 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, '"test " + status'); $source = new \V8\ScriptCompiler\Source($source_string); - $helper->assert('Source cache data is not set', $source->GetCachedData() === null); + $helper->assert('Source cache data is not set', $source->getCachedData() === null); try { - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); } catch (\V8\Exceptions\Exception $e) { $helper->exception_export($e); } @@ -81,12 +81,12 @@ $cache_data = null; $helper->header('Test generating code cache'); $source_string = new V8\StringValue($isolate, '"test " + status'); $source = new \V8\ScriptCompiler\Source($source_string); - $helper->assert('Source cache data is NULL', $source->GetCachedData() === null); - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kProduceCodeCache); - $helper->assert('Source cache data is update', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() === false); + $helper->assert('Source cache data is NULL', $source->getCachedData() === null); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kProduceCodeCache); + $helper->assert('Source cache data is update', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() === false); - $cache_data = $source->GetCachedData(); + $cache_data = $source->getCachedData(); $helper->line(); } @@ -94,10 +94,10 @@ $cache_data = null; $helper->header('Test consuming code cache'); $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() === false); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() === false); $helper->line(); } @@ -106,10 +106,10 @@ $cache_data = null; $helper->header('Test consuming code cache for wrong source'); $source_string = new V8\StringValue($isolate, '"other " + status'); $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is rejected', $source->GetCachedData()->isRejected() === true); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is rejected', $source->getCachedData()->isRejected() === true); $helper->line(); } @@ -118,10 +118,10 @@ $cache_data = null; $helper->header('Test consuming code cache for source with different formatting'); $source_string = new V8\StringValue($isolate, ' "test " + status'); $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() !== false); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() !== false); $helper->line(); } @@ -130,10 +130,10 @@ $cache_data = null; $helper->header('Test generating code cache when it already set'); $source_string = new V8\StringValue($isolate, '"test " + status'); $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kProduceCodeCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is rejected', $source->GetCachedData()->isRejected() === true); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kProduceCodeCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is rejected', $source->getCachedData()->isRejected() === true); $helper->line(); } @@ -143,10 +143,10 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, '"test " + status'); $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() !== true); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() !== true); $helper->line(); } @@ -156,9 +156,9 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, '"test " + status'); $source = new \V8\ScriptCompiler\Source($source_string); - $helper->assert('Source cache data is NULL', $source->GetCachedData() === null); - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kProduceParserCache); - $helper->assert('Source cache data is NOT updated', $source->GetCachedData() === null); + $helper->assert('Source cache data is NULL', $source->getCachedData() === null); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kProduceParserCache); + $helper->assert('Source cache data is NOT updated', $source->getCachedData() === null); $helper->line(); } @@ -176,12 +176,12 @@ $parser_cache_src= 'function test(arg1, args) { $source_string = new V8\StringValue($isolate, $parser_cache_src); $source = new \V8\ScriptCompiler\Source($source_string); - $helper->assert('Source cache data is NULL', $source->GetCachedData() === null); - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kProduceParserCache); - $helper->assert('Source cache data is update', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() === false); + $helper->assert('Source cache data is NULL', $source->getCachedData() === null); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kProduceParserCache); + $helper->assert('Source cache data is update', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() === false); - $cache_data = $source->GetCachedData(); + $cache_data = $source->getCachedData(); //$helper->dump($cache_data->getData()); $helper->line(); @@ -192,10 +192,10 @@ $parser_cache_src= 'function test(arg1, args) { $source_string = new V8\StringValue($isolate, $parser_cache_src); $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() === false); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() === false); $helper->line(); } @@ -206,9 +206,9 @@ $parser_cache_src= 'function test(arg1, args) { $bin = $cache_data->getData(); $source_string = new V8\StringValue($isolate, 'function test() { return 1+1;}'); $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); + $helper->assert('Source cache data is set', $source->getCachedData() != null); try { - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); } catch (\V8\Exceptions\TryCatchException $e) { $helper->exception_export($e); } @@ -222,11 +222,11 @@ $parser_cache_src= 'function test(arg1, args) { $bin = $cache_data->getData(); $source_string = new V8\StringValue($isolate, 'function test2() { return 1+1;}'); $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is rejected', $source->GetCachedData()->isRejected() === true); - $helper->assert('Source cache data is not changed', $source->GetCachedData()->getData() === $bin); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is rejected', $source->getCachedData()->isRejected() === true); + $helper->assert('Source cache data is not changed', $source->getCachedData()->getData() === $bin); $helper->line(); } @@ -236,10 +236,10 @@ $parser_cache_src= 'function test(arg1, args) { $source_string = new V8\StringValue($isolate, ' ' . $parser_cache_src); $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is rejected', $source->GetCachedData()->isRejected() === true); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is rejected', $source->getCachedData()->isRejected() === true); $helper->line(); } @@ -249,10 +249,10 @@ $parser_cache_src= 'function test(arg1, args) { $source_string = new V8\StringValue($isolate, $parser_cache_src); $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $script = V8\ScriptCompiler::Compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() === false); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $script = V8\ScriptCompiler::compile($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() === false); $helper->line(); } diff --git a/tests/V8ScriptCompiler_CompileFunctionInContext.phpt b/tests/V8ScriptCompiler_compileFunctionInContext.phpt similarity index 75% rename from tests/V8ScriptCompiler_CompileFunctionInContext.phpt rename to tests/V8ScriptCompiler_compileFunctionInContext.phpt index adf34c4..9f96d61 100644 --- a/tests/V8ScriptCompiler_CompileFunctionInContext.phpt +++ b/tests/V8ScriptCompiler_compileFunctionInContext.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ScriptCompiler::CompileFunctionInContext +V8\ScriptCompiler::compileFunctionInContext() --SKIPIF-- --FILE-- @@ -20,55 +20,55 @@ $helper->header('Compiling'); $source_string = new V8\StringValue($isolate, '"test"'); $source = new \V8\ScriptCompiler\Source($source_string); -$function = V8\ScriptCompiler::CompileFunctionInContext($context, $source); +$function = V8\ScriptCompiler::compileFunctionInContext($context, $source); $helper->assert('Compile function', $function instanceof \V8\FunctionObject); $source_string = new V8\StringValue($isolate, 'var i = 0; while (true) {i++;}'); $source = new \V8\ScriptCompiler\Source($source_string); -$function = V8\ScriptCompiler::CompileFunctionInContext($context, $source); +$function = V8\ScriptCompiler::compileFunctionInContext($context, $source); $helper->assert('Compile function', $function instanceof \V8\FunctionObject); $origin = new \V8\ScriptOrigin('test-module.js', 0, 0, false, 0, "", false, false, true); $source_string = new V8\StringValue($isolate, '"test"'); $source = new \V8\ScriptCompiler\Source($source_string, $origin); -$function = V8\ScriptCompiler::CompileFunctionInContext($context, $source); +$function = V8\ScriptCompiler::compileFunctionInContext($context, $source); $helper->assert('Compile module as function', $function instanceof \V8\FunctionObject); try { $source_string = new V8\StringValue($isolate, 'garbage garbage garbage'); $source = new \V8\ScriptCompiler\Source($source_string); - $function = V8\ScriptCompiler::CompileFunctionInContext($context, $source); + $function = V8\ScriptCompiler::compileFunctionInContext($context, $source); } catch (\V8\Exceptions\TryCatchException $e) { $helper->exception_export($e); - //$helper->dump($e->GetTryCatch()); + //$helper->dump($e->getTryCatch()); } $source_string = new V8\StringValue($isolate, 'test'); $source = new \V8\ScriptCompiler\Source($source_string); -$function = V8\ScriptCompiler::CompileFunctionInContext($context, $source, [new V8\StringValue($isolate, 'test')]); +$function = V8\ScriptCompiler::compileFunctionInContext($context, $source, [new V8\StringValue($isolate, 'test')]); $helper->assert('Compile function', $function instanceof \V8\FunctionObject); $source_string = new V8\StringValue($isolate, 'test'); $source = new \V8\ScriptCompiler\Source($source_string); -$function = V8\ScriptCompiler::CompileFunctionInContext($context, $source, [new V8\StringValue($isolate, 'test')], [new \V8\ObjectValue($context)]); +$function = V8\ScriptCompiler::compileFunctionInContext($context, $source, [new V8\StringValue($isolate, 'test')], [new \V8\ObjectValue($context)]); $helper->assert('Compile function', $function instanceof \V8\FunctionObject); $source_string = new V8\StringValue($isolate, '"test"'); $source = new \V8\ScriptCompiler\Source($source_string); -$function = V8\ScriptCompiler::CompileFunctionInContext($context, $source, [], [new \V8\ObjectValue($context)]); +$function = V8\ScriptCompiler::compileFunctionInContext($context, $source, [], [new \V8\ObjectValue($context)]); $helper->assert('Compile function', $function instanceof \V8\FunctionObject); $source_string = new V8\StringValue($isolate, '"test"'); $source = new \V8\ScriptCompiler\Source($source_string); -$function = V8\ScriptCompiler::CompileFunctionInContext($context, $source, [], [new V8\StringObject($context, new V8\StringValue($isolate, 'test'))]); +$function = V8\ScriptCompiler::compileFunctionInContext($context, $source, [], [new V8\StringObject($context, new V8\StringValue($isolate, 'test'))]); $helper->assert('Compile function', $function instanceof \V8\FunctionObject); try { $source_string = new V8\StringValue($isolate, '"test"'); $source = new \V8\ScriptCompiler\Source($source_string); - $function = V8\ScriptCompiler::CompileFunctionInContext($context, $source, [new V8\StringObject($context, new V8\StringValue($isolate, 'test'))]); + $function = V8\ScriptCompiler::compileFunctionInContext($context, $source, [new V8\StringObject($context, new V8\StringValue($isolate, 'test'))]); $helper->assert('Compile function', $function instanceof \V8\FunctionObject); } catch (TypeError $e) { $helper->exception_export($e); @@ -77,7 +77,7 @@ try { try { $source_string = new V8\StringValue($isolate, '"test"'); $source = new \V8\ScriptCompiler\Source($source_string); - $function = V8\ScriptCompiler::CompileFunctionInContext($context, $source, [], [new V8\StringValue($isolate, 'test')]); + $function = V8\ScriptCompiler::compileFunctionInContext($context, $source, [], [new V8\StringValue($isolate, 'test')]); $helper->assert('Compile function', $function instanceof \V8\FunctionObject); } catch (TypeError $e) { $helper->exception_export($e); @@ -90,37 +90,37 @@ $helper->header('Testing'); $source_string = new V8\StringValue($isolate, 'return "test";'); $source = new \V8\ScriptCompiler\Source($source_string); -$function = V8\ScriptCompiler::CompileFunctionInContext($context, $source); +$function = V8\ScriptCompiler::compileFunctionInContext($context, $source); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test_simple'), $function); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test_simple'), $function); -$helper->dump($v8_helper->CompileRun($context, 'test_simple("passed")')->Value()); +$helper->dump($v8_helper->CompileRun($context, 'test_simple("passed")')->value()); $source_string = new V8\StringValue($isolate, 'return "test " + status;'); $source = new \V8\ScriptCompiler\Source($source_string); -$function = V8\ScriptCompiler::CompileFunctionInContext($context, $source, [new \V8\StringValue($isolate, 'status')]); +$function = V8\ScriptCompiler::compileFunctionInContext($context, $source, [new \V8\StringValue($isolate, 'status')]); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test_with_parameter'), $function); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test_with_parameter'), $function); -$helper->dump($v8_helper->CompileRun($context, 'test_with_parameter("passed")')->Value()); +$helper->dump($v8_helper->CompileRun($context, 'test_with_parameter("passed")')->value()); $ctx_a = new \V8\ObjectValue($context); -$ctx_a->Set($context, new \V8\StringValue($isolate, 'foo'), new \V8\StringValue($isolate, 'foo from A')); -$ctx_a->Set($context, new \V8\StringValue($isolate, 'bar'), new \V8\StringValue($isolate, 'bar from A')); +$ctx_a->set($context, new \V8\StringValue($isolate, 'foo'), new \V8\StringValue($isolate, 'foo from A')); +$ctx_a->set($context, new \V8\StringValue($isolate, 'bar'), new \V8\StringValue($isolate, 'bar from A')); $ctx_b = new \V8\ObjectValue($context); -$ctx_b->Set($context, new \V8\StringValue($isolate, 'foo'), new \V8\StringValue($isolate, 'foo from B')); -$ctx_b->Set($context, new \V8\StringValue($isolate, 'baz'), new \V8\StringValue($isolate, 'baz from B')); +$ctx_b->set($context, new \V8\StringValue($isolate, 'foo'), new \V8\StringValue($isolate, 'foo from B')); +$ctx_b->set($context, new \V8\StringValue($isolate, 'baz'), new \V8\StringValue($isolate, 'baz from B')); $source_string = new V8\StringValue($isolate, 'return "test " + status + " " + foo + " " + bar + " " + baz;'); $source = new \V8\ScriptCompiler\Source($source_string); -$function = V8\ScriptCompiler::CompileFunctionInContext($context, $source, [new \V8\StringValue($isolate, 'status')], [$ctx_a, $ctx_b]); +$function = V8\ScriptCompiler::compileFunctionInContext($context, $source, [new \V8\StringValue($isolate, 'status')], [$ctx_a, $ctx_b]); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test_with_parameter_and_contexts'), $function); -$helper->dump($v8_helper->CompileRun($context, 'test_with_parameter_and_contexts("passed")')->Value()); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test_with_parameter_and_contexts'), $function); +$helper->dump($v8_helper->CompileRun($context, 'test_with_parameter_and_contexts("passed")')->value()); ?> --EXPECT-- @@ -134,8 +134,8 @@ Compile function: ok Compile function: ok Compile function: ok Compile function: ok -TypeError: Argument 3 passed to V8\ScriptCompiler::CompileFunctionInContext() must be an array of \V8\StringValue, instance of V8\StringObject given at 0 offset -TypeError: Argument 4 passed to V8\ScriptCompiler::CompileFunctionInContext() must be an array of \V8\ObjectValue, instance of V8\StringValue given at 0 offset +TypeError: Argument 3 passed to V8\ScriptCompiler::compileFunctionInContext() must be an array of \V8\StringValue, instance of V8\StringObject given at 0 offset +TypeError: Argument 4 passed to V8\ScriptCompiler::compileFunctionInContext() must be an array of \V8\ObjectValue, instance of V8\StringValue given at 0 offset Testing: diff --git a/tests/V8ScriptCompiler_CompileUnbound.phpt b/tests/V8ScriptCompiler_compileUnbound.phpt similarity index 71% rename from tests/V8ScriptCompiler_CompileUnbound.phpt rename to tests/V8ScriptCompiler_compileUnbound.phpt index 9902548..f0ea485 100644 --- a/tests/V8ScriptCompiler_CompileUnbound.phpt +++ b/tests/V8ScriptCompiler_compileUnbound.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\ScriptCompiler::CompileUnboundScript +V8\ScriptCompiler::compileUnboundScript() --SKIPIF-- --FILE-- @@ -21,21 +21,21 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, '"test"'); $source = new \V8\ScriptCompiler\Source($source_string); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source); $helper->assert('Compile script', $unbound instanceof \V8\UnboundScript); $source_string = new V8\StringValue($isolate, 'var i = 0; while (true) {i++;}'); $source = new \V8\ScriptCompiler\Source($source_string); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source); $helper->assert('Compile script', $unbound instanceof \V8\UnboundScript); try { $source_string = new V8\StringValue($isolate, 'garbage garbage garbage'); $source = new \V8\ScriptCompiler\Source($source_string); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source); } catch (\V8\Exceptions\TryCatchException $e) { $helper->exception_export($e); - //$helper->dump($e->GetTryCatch()); + //$helper->dump($e->getTryCatch()); } try { @@ -43,7 +43,7 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, '"test"'); $source = new \V8\ScriptCompiler\Source($source_string, $origin); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source); } catch (\V8\Exceptions\Exception $e) { $helper->exception_export($e); } @@ -56,18 +56,18 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, '"test " + status'); $source = new \V8\ScriptCompiler\Source($source_string); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source); - $context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'status'), new \V8\StringValue($isolate, 'passed')); + $context->globalObject()->set($context, new \V8\StringValue($isolate, 'status'), new \V8\StringValue($isolate, 'passed')); $context2 = new \V8\Context($isolate); - $context2->GlobalObject()->Set($context2, new \V8\StringValue($isolate, 'status'), new \V8\StringValue($isolate, 'passed for second context')); + $context2->globalObject()->set($context2, new \V8\StringValue($isolate, 'status'), new \V8\StringValue($isolate, 'passed for second context')); - $helper->dump($unbound->BindToContext($context)->Run($context)->Value()); - $helper->dump($unbound->BindToContext($context2)->Run($context)->Value()); - $helper->dump($unbound->BindToContext($context2)->Run($context2)->Value()); - $helper->dump($unbound->BindToContext($context)->Run($context2)->Value()); + $helper->dump($unbound->bindToContext($context)->run($context)->value()); + $helper->dump($unbound->bindToContext($context2)->run($context)->value()); + $helper->dump($unbound->bindToContext($context2)->run($context2)->value()); + $helper->dump($unbound->bindToContext($context)->run($context2)->value()); $helper->space(); } @@ -77,9 +77,9 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, '"test " + status');; $source = new \V8\ScriptCompiler\Source($source_string); - $helper->assert('Source cache data is not set', $source->GetCachedData() === null); + $helper->assert('Source cache data is not set', $source->getCachedData() === null); try { - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); } catch (\V8\Exceptions\Exception $e) { $helper->exception_export($e); } @@ -89,12 +89,12 @@ $cache_data = null; $helper->header('Test generating code cache'); $source_string = new V8\StringValue($isolate, '"test " + status');; $source = new \V8\ScriptCompiler\Source($source_string); - $helper->assert('Source cache data is NULL', $source->GetCachedData() === null); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kProduceCodeCache); - $helper->assert('Source cache data is update', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() === false); + $helper->assert('Source cache data is NULL', $source->getCachedData() === null); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kProduceCodeCache); + $helper->assert('Source cache data is update', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() === false); - $cache_data = $source->GetCachedData(); + $cache_data = $source->getCachedData(); $helper->line(); } @@ -102,10 +102,10 @@ $cache_data = null; $helper->header('Test consuming code cache'); $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() === false); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() === false); $helper->line(); } @@ -114,10 +114,10 @@ $cache_data = null; $helper->header('Test consuming code cache for wrong source'); $source_string = new V8\StringValue($isolate, '"other " + status');; $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is rejected', $source->GetCachedData()->isRejected() === true); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is rejected', $source->getCachedData()->isRejected() === true); $helper->line(); } @@ -126,10 +126,10 @@ $cache_data = null; $helper->header('Test consuming code cache for source with different formatting'); $source_string = new V8\StringValue($isolate, ' "test " + status');; $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() !== false); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() !== false); $helper->line(); } @@ -138,10 +138,10 @@ $cache_data = null; $helper->header('Test generating code cache when it already set'); $source_string = new V8\StringValue($isolate, '"test " + status');; $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kProduceCodeCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is rejected', $source->GetCachedData()->isRejected() === true); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kProduceCodeCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is rejected', $source->getCachedData()->isRejected() === true); $helper->line(); } @@ -151,10 +151,10 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, '"test " + status');; $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() !== true); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() !== true); $helper->line(); } @@ -164,9 +164,9 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, '"test " + status');; $source = new \V8\ScriptCompiler\Source($source_string); - $helper->assert('Source cache data is NULL', $source->GetCachedData() === null); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kProduceParserCache); - $helper->assert('Source cache data is NOT updated', $source->GetCachedData() === null); + $helper->assert('Source cache data is NULL', $source->getCachedData() === null); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kProduceParserCache); + $helper->assert('Source cache data is NOT updated', $source->getCachedData() === null); $helper->line(); } @@ -176,12 +176,12 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, 'function test() { return 1+1;}');; $source = new \V8\ScriptCompiler\Source($source_string); - $helper->assert('Source cache data is NULL', $source->GetCachedData() === null); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kProduceParserCache); - $helper->assert('Source cache data is update', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() === false); + $helper->assert('Source cache data is NULL', $source->getCachedData() === null); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kProduceParserCache); + $helper->assert('Source cache data is update', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() === false); - $cache_data = $source->GetCachedData(); + $cache_data = $source->getCachedData(); $helper->line(); } @@ -191,10 +191,10 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, 'function test() { return 1+1;}');; $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() === false); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeParserCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() === false); $helper->line(); } @@ -204,10 +204,10 @@ $cache_data = null; $source_string = new V8\StringValue($isolate, 'function test() { return 1+1;}');; $source = new \V8\ScriptCompiler\Source($source_string, null, $cache_data); - $helper->assert('Source cache data is set', $source->GetCachedData() != null); - $unbound = V8\ScriptCompiler::CompileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); - $helper->assert('Source cache data is still set', $source->GetCachedData() != null); - $helper->assert('Source cache data is not rejected', $source->GetCachedData()->isRejected() === false); + $helper->assert('Source cache data is set', $source->getCachedData() != null); + $unbound = V8\ScriptCompiler::compileUnboundScript($context, $source, V8\ScriptCompiler\CompileOptions::kConsumeCodeCache); + $helper->assert('Source cache data is still set', $source->getCachedData() != null); + $helper->assert('Source cache data is not rejected', $source->getCachedData()->isRejected() === false); $helper->line(); } diff --git a/tests/V8ScriptOrigin.phpt b/tests/V8ScriptOrigin.phpt index 263b568..11ac61c 100644 --- a/tests/V8ScriptOrigin.phpt +++ b/tests/V8ScriptOrigin.phpt @@ -16,19 +16,19 @@ $helper->space(); $helper->header('Test getters (default)'); -$helper->method_matches_with_output($obj, 'ResourceName', 'test'); -$helper->method_matches_with_output($obj, 'ResourceLineOffset', 0); -$helper->method_matches_with_output($obj, 'ResourceColumnOffset', 0); -$helper->method_matches_with_output($obj, 'ScriptID', 0); -$helper->method_matches_with_output($obj, 'SourceMapUrl', ''); -$helper->method_matches_instanceof($obj, 'Options', V8\ScriptOriginOptions::class); +$helper->method_matches_with_output($obj, 'resourceName', 'test'); +$helper->method_matches_with_output($obj, 'resourceLineOffset', 0); +$helper->method_matches_with_output($obj, 'resourceColumnOffset', 0); +$helper->method_matches_with_output($obj, 'scriptID', 0); +$helper->method_matches_with_output($obj, 'sourceMapUrl', ''); +$helper->method_matches_instanceof($obj, 'options', V8\ScriptOriginOptions::class); $helper->space(); -$options = $obj->Options(); +$options = $obj->options(); $helper->header('Test options getters (default)'); -$helper->method_matches_with_output($options, 'IsSharedCrossOrigin', false); -$helper->method_matches_with_output($options, 'IsOpaque', false); +$helper->method_matches_with_output($options, 'isSharedCrossOrigin', false); +$helper->method_matches_with_output($options, 'isOpaque', false); $helper->space(); @@ -40,21 +40,21 @@ $helper->space(); $helper->header('Test getters'); -$helper->method_matches_with_output($obj, 'ResourceName', 'test'); -$helper->method_matches_with_output($obj, 'ResourceLineOffset', 1); -$helper->method_matches_with_output($obj, 'ResourceColumnOffset', 2); -$helper->method_matches_with_output($obj, 'ScriptID', 3); -$helper->method_matches_with_output($obj, 'SourceMapUrl', 'map'); -$helper->method_matches_instanceof($obj, 'Options', V8\ScriptOriginOptions::class); +$helper->method_matches_with_output($obj, 'resourceName', 'test'); +$helper->method_matches_with_output($obj, 'resourceLineOffset', 1); +$helper->method_matches_with_output($obj, 'resourceColumnOffset', 2); +$helper->method_matches_with_output($obj, 'scriptID', 3); +$helper->method_matches_with_output($obj, 'sourceMapUrl', 'map'); +$helper->method_matches_instanceof($obj, 'options', V8\ScriptOriginOptions::class); $helper->space(); -$options = $obj->Options(); +$options = $obj->options(); $helper->header('Test options getters'); -$helper->method_matches_with_output($options, 'IsSharedCrossOrigin', true); -$helper->method_matches_with_output($options, 'IsOpaque', true); -$helper->method_matches_with_output($options, 'IsWasm', true); -$helper->method_matches_with_output($options, 'IsModule', true); +$helper->method_matches_with_output($options, 'isSharedCrossOrigin', true); +$helper->method_matches_with_output($options, 'isOpaque', true); +$helper->method_matches_with_output($options, 'isWasm', true); +$helper->method_matches_with_output($options, 'isModule', true); $helper->space(); ?> @@ -88,18 +88,18 @@ object(V8\ScriptOrigin)#2 (6) { Test getters (default): ----------------------- -V8\ScriptOrigin::ResourceName() matches expected 'test' -V8\ScriptOrigin::ResourceLineOffset() matches expected 0 -V8\ScriptOrigin::ResourceColumnOffset() matches expected 0 -V8\ScriptOrigin::ScriptID() matches expected 0 -V8\ScriptOrigin::SourceMapUrl() matches expected '' -V8\ScriptOrigin::Options() result is instance of V8\ScriptOriginOptions +V8\ScriptOrigin::resourceName() matches expected 'test' +V8\ScriptOrigin::resourceLineOffset() matches expected 0 +V8\ScriptOrigin::resourceColumnOffset() matches expected 0 +V8\ScriptOrigin::scriptID() matches expected 0 +V8\ScriptOrigin::sourceMapUrl() matches expected '' +V8\ScriptOrigin::options() result is instance of V8\ScriptOriginOptions Test options getters (default): ------------------------------- -V8\ScriptOriginOptions::IsSharedCrossOrigin() matches expected false -V8\ScriptOriginOptions::IsOpaque() matches expected false +V8\ScriptOriginOptions::isSharedCrossOrigin() matches expected false +V8\ScriptOriginOptions::isOpaque() matches expected false Object representation: @@ -131,17 +131,17 @@ object(V8\ScriptOrigin)#4 (6) { Test getters: ------------- -V8\ScriptOrigin::ResourceName() matches expected 'test' -V8\ScriptOrigin::ResourceLineOffset() matches expected 1 -V8\ScriptOrigin::ResourceColumnOffset() matches expected 2 -V8\ScriptOrigin::ScriptID() matches expected 3 -V8\ScriptOrigin::SourceMapUrl() matches expected 'map' -V8\ScriptOrigin::Options() result is instance of V8\ScriptOriginOptions +V8\ScriptOrigin::resourceName() matches expected 'test' +V8\ScriptOrigin::resourceLineOffset() matches expected 1 +V8\ScriptOrigin::resourceColumnOffset() matches expected 2 +V8\ScriptOrigin::scriptID() matches expected 3 +V8\ScriptOrigin::sourceMapUrl() matches expected 'map' +V8\ScriptOrigin::options() result is instance of V8\ScriptOriginOptions Test options getters: --------------------- -V8\ScriptOriginOptions::IsSharedCrossOrigin() matches expected true -V8\ScriptOriginOptions::IsOpaque() matches expected true -V8\ScriptOriginOptions::IsWasm() matches expected true -V8\ScriptOriginOptions::IsModule() matches expected true +V8\ScriptOriginOptions::isSharedCrossOrigin() matches expected true +V8\ScriptOriginOptions::isOpaque() matches expected true +V8\ScriptOriginOptions::isWasm() matches expected true +V8\ScriptOriginOptions::isModule() matches expected true diff --git a/tests/V8ScriptOriginOptions.phpt b/tests/V8ScriptOriginOptions.phpt index 107edd0..ba91620 100644 --- a/tests/V8ScriptOriginOptions.phpt +++ b/tests/V8ScriptOriginOptions.phpt @@ -78,10 +78,10 @@ object(V8\ScriptOriginOptions)#2 (4) { Test getters (default): ----------------------- -V8\ScriptOriginOptions->IsSharedCrossOrigin(): bool(false) -V8\ScriptOriginOptions->IsOpaque(): bool(false) -V8\ScriptOriginOptions->IsWasm(): bool(false) -V8\ScriptOriginOptions->IsModule(): bool(false) +V8\ScriptOriginOptions->isSharedCrossOrigin(): bool(false) +V8\ScriptOriginOptions->isOpaque(): bool(false) +V8\ScriptOriginOptions->isWasm(): bool(false) +V8\ScriptOriginOptions->isModule(): bool(false) Object representation: @@ -100,10 +100,10 @@ object(V8\ScriptOriginOptions)#11 (4) { Test getters: ------------- -V8\ScriptOriginOptions->IsSharedCrossOrigin(): bool(true) -V8\ScriptOriginOptions->IsOpaque(): bool(false) -V8\ScriptOriginOptions->IsWasm(): bool(false) -V8\ScriptOriginOptions->IsModule(): bool(false) +V8\ScriptOriginOptions->isSharedCrossOrigin(): bool(true) +V8\ScriptOriginOptions->isOpaque(): bool(false) +V8\ScriptOriginOptions->isWasm(): bool(false) +V8\ScriptOriginOptions->isModule(): bool(false) Object representation: @@ -122,10 +122,10 @@ object(V8\ScriptOriginOptions)#4 (4) { Test getters: ------------- -V8\ScriptOriginOptions->IsSharedCrossOrigin(): bool(false) -V8\ScriptOriginOptions->IsOpaque(): bool(true) -V8\ScriptOriginOptions->IsWasm(): bool(false) -V8\ScriptOriginOptions->IsModule(): bool(false) +V8\ScriptOriginOptions->isSharedCrossOrigin(): bool(false) +V8\ScriptOriginOptions->isOpaque(): bool(true) +V8\ScriptOriginOptions->isWasm(): bool(false) +V8\ScriptOriginOptions->isModule(): bool(false) Object representation: @@ -144,10 +144,10 @@ object(V8\ScriptOriginOptions)#10 (4) { Test getters: ------------- -V8\ScriptOriginOptions->IsSharedCrossOrigin(): bool(false) -V8\ScriptOriginOptions->IsOpaque(): bool(false) -V8\ScriptOriginOptions->IsWasm(): bool(false) -V8\ScriptOriginOptions->IsModule(): bool(false) +V8\ScriptOriginOptions->isSharedCrossOrigin(): bool(false) +V8\ScriptOriginOptions->isOpaque(): bool(false) +V8\ScriptOriginOptions->isWasm(): bool(false) +V8\ScriptOriginOptions->isModule(): bool(false) Object representation: @@ -166,7 +166,7 @@ object(V8\ScriptOriginOptions)#6 (4) { Test getters: ------------- -V8\ScriptOriginOptions->IsSharedCrossOrigin(): bool(false) -V8\ScriptOriginOptions->IsOpaque(): bool(false) -V8\ScriptOriginOptions->IsWasm(): bool(false) -V8\ScriptOriginOptions->IsModule(): bool(false) +V8\ScriptOriginOptions->isSharedCrossOrigin(): bool(false) +V8\ScriptOriginOptions->isOpaque(): bool(false) +V8\ScriptOriginOptions->isWasm(): bool(false) +V8\ScriptOriginOptions->isModule(): bool(false) diff --git a/tests/V8Script_Run.phpt b/tests/V8Script_Run.phpt deleted file mode 100644 index de7f6f7..0000000 --- a/tests/V8Script_Run.phpt +++ /dev/null @@ -1,122 +0,0 @@ ---TEST-- -V8\Script::Run ---SKIPIF-- - ---FILE-- -Set(new \V8\StringValue($isolate, 'test'), $value); -$context = new V8\Context($isolate, $global_template); - - -$source = 'test; test = test + ", confirmed"'; -$file_name = 'test.js'; - -$script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context); - -$v8_helper->run_checks($res); - -$helper->dump($res->Value()); - -$helper->space(); - -$scalar = new V8\Int32Value($isolate, 123); -$obj = new V8\ObjectValue($context); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'scalar'), $scalar); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'obj'), $obj); - -$res = $v8_helper->CompileTryRun($context, 'scalar'); - -$helper->header('Scalar'); -$helper->value_matches($res->Value(), $scalar->Value()); -$helper->value_matches_with_no_output($res, $scalar); - -$helper->space(); - - -$res = $v8_helper->CompileTryRun($context, 'obj'); - -$helper->header('Object'); -$helper->value_matches_with_no_output($res, $obj); - -?> ---EXPECT-- -Checks on V8\StringValue: -------------------------- -V8\StringValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "string" - -V8\StringValue->IsOneByte(): bool(true) -V8\StringValue(V8\Value)->IsUndefined(): bool(false) -V8\StringValue(V8\Value)->IsNull(): bool(false) -V8\StringValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\StringValue(V8\Value)->IsTrue(): bool(false) -V8\StringValue(V8\Value)->IsFalse(): bool(false) -V8\StringValue(V8\Value)->IsName(): bool(true) -V8\StringValue(V8\Value)->IsString(): bool(true) -V8\StringValue(V8\Value)->IsSymbol(): bool(false) -V8\StringValue(V8\Value)->IsFunction(): bool(false) -V8\StringValue(V8\Value)->IsArray(): bool(false) -V8\StringValue(V8\Value)->IsObject(): bool(false) -V8\StringValue(V8\Value)->IsBoolean(): bool(false) -V8\StringValue(V8\Value)->IsNumber(): bool(false) -V8\StringValue(V8\Value)->IsInt32(): bool(false) -V8\StringValue(V8\Value)->IsUint32(): bool(false) -V8\StringValue(V8\Value)->IsDate(): bool(false) -V8\StringValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\StringValue(V8\Value)->IsBooleanObject(): bool(false) -V8\StringValue(V8\Value)->IsNumberObject(): bool(false) -V8\StringValue(V8\Value)->IsStringObject(): bool(false) -V8\StringValue(V8\Value)->IsSymbolObject(): bool(false) -V8\StringValue(V8\Value)->IsNativeError(): bool(false) -V8\StringValue(V8\Value)->IsRegExp(): bool(false) -V8\StringValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\StringValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\StringValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\StringValue(V8\Value)->IsPromise(): bool(false) -V8\StringValue(V8\Value)->IsMap(): bool(false) -V8\StringValue(V8\Value)->IsSet(): bool(false) -V8\StringValue(V8\Value)->IsMapIterator(): bool(false) -V8\StringValue(V8\Value)->IsSetIterator(): bool(false) -V8\StringValue(V8\Value)->IsWeakMap(): bool(false) -V8\StringValue(V8\Value)->IsWeakSet(): bool(false) -V8\StringValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\StringValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\StringValue(V8\Value)->IsTypedArray(): bool(false) -V8\StringValue(V8\Value)->IsUint8Array(): bool(false) -V8\StringValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\StringValue(V8\Value)->IsInt8Array(): bool(false) -V8\StringValue(V8\Value)->IsUint16Array(): bool(false) -V8\StringValue(V8\Value)->IsInt16Array(): bool(false) -V8\StringValue(V8\Value)->IsUint32Array(): bool(false) -V8\StringValue(V8\Value)->IsInt32Array(): bool(false) -V8\StringValue(V8\Value)->IsFloat32Array(): bool(false) -V8\StringValue(V8\Value)->IsFloat64Array(): bool(false) -V8\StringValue(V8\Value)->IsDataView(): bool(false) -V8\StringValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\StringValue(V8\Value)->IsProxy(): bool(false) - - -string(25) "TEST VALUE 111, confirmed" - - -Scalar: -------- -Expected 123 value is identical to actual value 123 -Expected value is not identical to actual value - - -Object: -------- -Expected value is identical to actual value diff --git a/tests/V8Script_exit_during_script_execution.phpt b/tests/V8Script_exit_during_script_execution.phpt index f01a7c8..7ad8685 100644 --- a/tests/V8Script_exit_during_script_execution.phpt +++ b/tests/V8Script_exit_during_script_execution.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\Script::Run - exit during script execution +V8\Script::run() - exit during script execution --SKIPIF-- --FILE-- @@ -26,7 +26,7 @@ $exit = new v8Tests\TrackingDtors\FunctionTemplate($isolate, function () { exit(); }); -$global_template->Set(new \V8\StringValue($isolate, 'exit'), $exit, \V8\PropertyAttribute::DontDelete); +$global_template->set(new \V8\StringValue($isolate, 'exit'), $exit, \V8\PropertyAttribute::DontDelete); $context = new v8Tests\TrackingDtors\Context($isolate, $global_template); $v8_helper->injectConsoleLog($context); @@ -43,7 +43,7 @@ $script = new v8Tests\TrackingDtors\Script($context, new \V8\StringValue($isolat $isolate = null; $global_template = null; $exit = null; -$script->Run($context); +$script->run($context); $context = null; diff --git a/tests/V8Script_run.phpt b/tests/V8Script_run.phpt new file mode 100644 index 0000000..181c102 --- /dev/null +++ b/tests/V8Script_run.phpt @@ -0,0 +1,122 @@ +--TEST-- +V8\Script::run() +--SKIPIF-- + +--FILE-- +set(new \V8\StringValue($isolate, 'test'), $value); +$context = new V8\Context($isolate, $global_template); + + +$source = 'test; test = test + ", confirmed"'; +$file_name = 'test.js'; + +$script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); +$res = $script->run($context); + +$v8_helper->run_checks($res); + +$helper->dump($res->value()); + +$helper->space(); + +$scalar = new V8\Int32Value($isolate, 123); +$obj = new V8\ObjectValue($context); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'scalar'), $scalar); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'obj'), $obj); + +$res = $v8_helper->CompileTryRun($context, 'scalar'); + +$helper->header('Scalar'); +$helper->value_matches($res->value(), $scalar->value()); +$helper->value_matches_with_no_output($res, $scalar); + +$helper->space(); + + +$res = $v8_helper->CompileTryRun($context, 'obj'); + +$helper->header('Object'); +$helper->value_matches_with_no_output($res, $obj); + +?> +--EXPECT-- +Checks on V8\StringValue: +------------------------- +V8\StringValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "string" + +V8\StringValue->isOneByte(): bool(true) +V8\StringValue(V8\Value)->isUndefined(): bool(false) +V8\StringValue(V8\Value)->isNull(): bool(false) +V8\StringValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\StringValue(V8\Value)->isTrue(): bool(false) +V8\StringValue(V8\Value)->isFalse(): bool(false) +V8\StringValue(V8\Value)->isName(): bool(true) +V8\StringValue(V8\Value)->isString(): bool(true) +V8\StringValue(V8\Value)->isSymbol(): bool(false) +V8\StringValue(V8\Value)->isFunction(): bool(false) +V8\StringValue(V8\Value)->isArray(): bool(false) +V8\StringValue(V8\Value)->isObject(): bool(false) +V8\StringValue(V8\Value)->isBoolean(): bool(false) +V8\StringValue(V8\Value)->isNumber(): bool(false) +V8\StringValue(V8\Value)->isInt32(): bool(false) +V8\StringValue(V8\Value)->isUint32(): bool(false) +V8\StringValue(V8\Value)->isDate(): bool(false) +V8\StringValue(V8\Value)->isArgumentsObject(): bool(false) +V8\StringValue(V8\Value)->isBooleanObject(): bool(false) +V8\StringValue(V8\Value)->isNumberObject(): bool(false) +V8\StringValue(V8\Value)->isStringObject(): bool(false) +V8\StringValue(V8\Value)->isSymbolObject(): bool(false) +V8\StringValue(V8\Value)->isNativeError(): bool(false) +V8\StringValue(V8\Value)->isRegExp(): bool(false) +V8\StringValue(V8\Value)->isAsyncFunction(): bool(false) +V8\StringValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\StringValue(V8\Value)->isGeneratorObject(): bool(false) +V8\StringValue(V8\Value)->isPromise(): bool(false) +V8\StringValue(V8\Value)->isMap(): bool(false) +V8\StringValue(V8\Value)->isSet(): bool(false) +V8\StringValue(V8\Value)->isMapIterator(): bool(false) +V8\StringValue(V8\Value)->isSetIterator(): bool(false) +V8\StringValue(V8\Value)->isWeakMap(): bool(false) +V8\StringValue(V8\Value)->isWeakSet(): bool(false) +V8\StringValue(V8\Value)->isArrayBuffer(): bool(false) +V8\StringValue(V8\Value)->isArrayBufferView(): bool(false) +V8\StringValue(V8\Value)->isTypedArray(): bool(false) +V8\StringValue(V8\Value)->isUint8Array(): bool(false) +V8\StringValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\StringValue(V8\Value)->isInt8Array(): bool(false) +V8\StringValue(V8\Value)->isUint16Array(): bool(false) +V8\StringValue(V8\Value)->isInt16Array(): bool(false) +V8\StringValue(V8\Value)->isUint32Array(): bool(false) +V8\StringValue(V8\Value)->isInt32Array(): bool(false) +V8\StringValue(V8\Value)->isFloat32Array(): bool(false) +V8\StringValue(V8\Value)->isFloat64Array(): bool(false) +V8\StringValue(V8\Value)->isDataView(): bool(false) +V8\StringValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\StringValue(V8\Value)->isProxy(): bool(false) + + +string(25) "TEST VALUE 111, confirmed" + + +Scalar: +------- +Expected 123 value is identical to actual value 123 +Expected value is not identical to actual value + + +Object: +------- +Expected value is identical to actual value diff --git a/tests/V8Script_Run_out_of_memory.phpt b/tests/V8Script_run_out_of_memory.phpt similarity index 87% rename from tests/V8Script_Run_out_of_memory.phpt rename to tests/V8Script_run_out_of_memory.phpt index be3c514..fb65e0c 100644 --- a/tests/V8Script_Run_out_of_memory.phpt +++ b/tests/V8Script_run_out_of_memory.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\Script::Run() - out of memory example +V8\Script::run() - out of memory example --SKIPIF-- @@ -17,7 +17,7 @@ $global_template = new V8\ObjectTemplate($isolate); $value = new V8\StringValue($isolate, 'TEST VALUE 111'); -$global_template->Set(new \V8\StringValue($isolate, 'test'), $value); +$global_template->set(new \V8\StringValue($isolate, 'test'), $value); $context = new V8\Context($isolate, $global_template); $v8_helper->injectConsoleLog($context); @@ -47,26 +47,26 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); try { - $res = $script->Run($context); + $res = $script->run($context); } catch (\Exception $e) { $helper->exception_export($e); } $v8_helper->run_checks($value); -$helper->dump($res->Value()); +$helper->dump($res->value()); $helper->space(); $scalar = new V8\NumberValue($isolate, 123); $obj = new V8\ObjectValue($context); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'scalar'), $scalar); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'obj'), $obj); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'scalar'), $scalar); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'obj'), $obj); $res = $v8_helper->CompileTryRun($context, 'scalar'); $helper->header('Scalar'); -$helper->value_matches($res->Value(), $scalar->Value()); +$helper->value_matches($res->value(), $scalar->value()); $helper->value_matches_with_no_output($res, $scalar); $helper->space(); diff --git a/tests/V8Script_Run_uncaught_exception.phpt b/tests/V8Script_run_uncaught_exception.phpt similarity index 83% rename from tests/V8Script_Run_uncaught_exception.phpt rename to tests/V8Script_run_uncaught_exception.phpt index 2ff989a..6810ec2 100644 --- a/tests/V8Script_Run_uncaught_exception.phpt +++ b/tests/V8Script_run_uncaught_exception.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\Script::Run() - uncaught exception should not lead to leak +V8\Script::run() - uncaught exception should not lead to leak --SKIPIF-- --FILE-- @@ -17,7 +17,7 @@ $obj = $v8_helper->CompileRun(new \V8\Context(new \V8\Isolate()), 'test'); --EXPECTF-- Fatal error: Uncaught V8\Exceptions\TryCatchException: ReferenceError: test is not defined in %s Stack trace: -#0 %s: V8\Script->Run(Object(V8\Context)) +#0 %s: V8\Script->run(Object(V8\Context)) #1 %s: PhpV8Helpers->CompileRun(Object(V8\Context), Object(V8\Script)) #2 {main} thrown in %s diff --git a/tests/V8Script_terminate_script_execution.phpt b/tests/V8Script_terminate_script_execution.phpt index db1bde4..3245d36 100644 --- a/tests/V8Script_terminate_script_execution.phpt +++ b/tests/V8Script_terminate_script_execution.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\Script::Run - terminate script execution +V8\Script::run() - terminate script execution --SKIPIF-- --FILE-- @@ -15,22 +15,22 @@ require '.tracking_dtors.php'; $isolate = new v8Tests\TrackingDtors\Isolate(); -//$isolate->SetCaptureStackTraceForUncaughtExceptions(true); +//$isolate->setCaptureStackTraceForUncaughtExceptions(true); $global_template = new V8\ObjectTemplate($isolate); $timer = 0; $terminate = new V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $info) use (&$timer) { echo 'Going to terminate', PHP_EOL; - $isolate = $info->GetIsolate(); + $isolate = $info->getIsolate(); // throw new Exception('test'); $timer = microtime(true); - $script = new V8\Script($info->GetContext(), new \V8\StringValue($isolate, 'for(;;);'), new \V8\ScriptOrigin('wait_for_termination.js')); - $isolate->TerminateExecution(); + $script = new V8\Script($info->getContext(), new \V8\StringValue($isolate, 'for(;;);'), new \V8\ScriptOrigin('wait_for_termination.js')); + $isolate->terminateExecution(); try { - $script->Run($info->GetContext()); + $script->run($info->getContext()); } catch (\V8\Exceptions\TerminationException $e) { echo 'wait loop terminated', PHP_EOL; } @@ -38,7 +38,7 @@ $terminate = new V8\FunctionTemplate($isolate, function (\V8\FunctionCallbackInf $e = null; }); -$global_template->Set(new \V8\StringValue($isolate, 'terminate'), $terminate, \V8\PropertyAttribute::DontDelete); +$global_template->set(new \V8\StringValue($isolate, 'terminate'), $terminate, \V8\PropertyAttribute::DontDelete); $context = new V8\Context($isolate, $global_template); $v8_helper->injectConsoleLog($context); diff --git a/tests/V8SetObject.phpt b/tests/V8SetObject.phpt index 5525ee4..e41ea05 100644 --- a/tests/V8SetObject.phpt +++ b/tests/V8SetObject.phpt @@ -26,27 +26,27 @@ $helper->space(); $helper->assert('SetObject extends Value', $value instanceof \V8\Value); $helper->assert('SetObject does not extend PrimitiveValue', !($value instanceof \V8\PrimitiveValue)); $helper->assert('SetObject implements AdjustableExternalMemoryInterface', $value instanceof \V8\AdjustableExternalMemoryInterface); -$helper->assert('SetObject is instanceof Set', $value->InstanceOf($context, $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'Set')))); +$helper->assert('SetObject is instanceof Set', $value->instanceOf($context, $context->globalObject()->get($context, new \V8\StringValue($isolate, 'Set')))); $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_matches($value, 'GetContext', $context); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_matches($value, 'getContext', $context); $helper->space(); $helper->header('Getters'); -$helper->assert('GetIdentityHash is integer', gettype($value->GetIdentityHash()), 'integer'); +$helper->assert('GetIdentityHash is integer', gettype($value->getIdentityHash()), 'integer'); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); $helper->header('Converters'); -$helper->dump_object_methods($value, ['@@default' => [$context]], new RegexpFilter('/^To/')); +$helper->dump_object_methods($value, ['@@default' => [$context]], new RegexpFilter('/^to/')); $helper->space(); $helper->header('New value creation from V8 runtime'); -$filter = new ArrayListFilter(['IsObject', 'IsMap', 'IsWeakMap', 'IsSet', 'IsWeakSet'], false); +$filter = new ArrayListFilter(['isObject', 'isMap', 'isWeakMap', 'isSet', 'isWeakSet'], false); $new_map = $v8_helper->CompileRun($context, "new Set()"); $helper->assert('New set from V8 is instance of \V8\SetObject', $new_map instanceof \V8\SetObject); $helper->dump_object_methods($new_map, [], $filter); @@ -64,43 +64,43 @@ $key = new \V8\ObjectValue($context); $key2 = new \V8\ObjectValue($context); $nonexistent_key = new \V8\ObjectValue($context); -$helper->method_export($value, 'Size'); -$helper->assert('Can add key', $value->Add($context, $key), $value); -$helper->assert('Can add another different key', $value->Add($context, $key2), $value); -$helper->method_export($value, 'Size'); -$helper->assert('Cannot add another same key', $value->Add($context, $key2), $value); -$helper->method_export($value, 'Size'); +$helper->method_export($value, 'size'); +$helper->assert('Can add key', $value->add($context, $key), $value); +$helper->assert('Can add another different key', $value->add($context, $key2), $value); +$helper->method_export($value, 'size'); +$helper->assert('Cannot add another same key', $value->add($context, $key2), $value); +$helper->method_export($value, 'size'); $helper->line(); -$helper->assert('Key exists', $value->Has($context, $key)); -$helper->assert('Another key exists', $value->Has($context, $key2)); +$helper->assert('Key exists', $value->has($context, $key)); +$helper->assert('Another key exists', $value->has($context, $key2)); -$helper->assert('Nonexistent key does not exists', $value->Has($context, $nonexistent_key), false); +$helper->assert('Nonexistent key does not exists', $value->has($context, $nonexistent_key), false); $helper->line(); -$helper->method_export($value, 'Size'); -$helper->method_matches_instanceof($value, 'AsArray', \V8\ArrayObject::class); +$helper->method_export($value, 'size'); +$helper->method_matches_instanceof($value, 'asArray', \V8\ArrayObject::class); $helper->line(); -$arr = $value->AsArray(); -$helper->assert('SetObject Array representation has valid length', $arr->Length() == 2); -$helper->assert('SetObject Array contains key', $arr->Get($context, new \V8\Uint32Value($isolate, 0)), $key); -$helper->assert('SetObject Array contains another key', $arr->Get($context, new \V8\Uint32Value($isolate, 1)), $key2); +$arr = $value->asArray(); +$helper->assert('SetObject Array representation has valid length', $arr->length() == 2); +$helper->assert('SetObject Array contains key', $arr->get($context, new \V8\Uint32Value($isolate, 0)), $key); +$helper->assert('SetObject Array contains another key', $arr->get($context, new \V8\Uint32Value($isolate, 1)), $key2); $helper->line(); -$helper->assert('Delete existent key', $value->Delete($context, $key)); -$helper->assert('Deleted key does not exists', $value->Has($context, $key), false); -$helper->assert('Delete nonexistent key fails', $value->Delete($context, $nonexistent_key), false); -$helper->assert('Deleted nonexistent key does not exists', $value->Has($context, $nonexistent_key), false); -$helper->method_export($value, 'Size'); +$helper->assert('Delete existent key', $value->delete($context, $key)); +$helper->assert('Deleted key does not exists', $value->has($context, $key), false); +$helper->assert('Delete nonexistent key fails', $value->delete($context, $nonexistent_key), false); +$helper->assert('Deleted nonexistent key does not exists', $value->has($context, $nonexistent_key), false); +$helper->method_export($value, 'size'); $helper->line(); -$value->Add($context, new \V8\ObjectValue($context)); -$value->Add($context, new \V8\NumberValue($isolate, 42)); -$helper->method_export($value, 'Size'); -$helper->method_export($value, 'Clear'); -$helper->method_export($value, 'Size'); +$value->add($context, new \V8\ObjectValue($context)); +$value->add($context, new \V8\NumberValue($isolate, 42)); +$helper->method_export($value, 'size'); +$helper->method_export($value, 'clear'); +$helper->method_export($value, 'size'); ?> @@ -127,8 +127,8 @@ SetObject is instanceof Set: ok Accessors: ---------- -V8\SetObject::GetIsolate() matches expected value -V8\SetObject::GetContext() matches expected value +V8\SetObject::getIsolate() matches expected value +V8\SetObject::getContext() matches expected value Getters: @@ -138,87 +138,87 @@ GetIdentityHash is integer: ok Checkers: --------- -V8\SetObject(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\SetObject(V8\ObjectValue)->IsCallable(): bool(false) -V8\SetObject(V8\ObjectValue)->IsConstructor(): bool(false) -V8\SetObject(V8\Value)->IsUndefined(): bool(false) -V8\SetObject(V8\Value)->IsNull(): bool(false) -V8\SetObject(V8\Value)->IsNullOrUndefined(): bool(false) -V8\SetObject(V8\Value)->IsTrue(): bool(false) -V8\SetObject(V8\Value)->IsFalse(): bool(false) -V8\SetObject(V8\Value)->IsName(): bool(false) -V8\SetObject(V8\Value)->IsString(): bool(false) -V8\SetObject(V8\Value)->IsSymbol(): bool(false) -V8\SetObject(V8\Value)->IsFunction(): bool(false) -V8\SetObject(V8\Value)->IsArray(): bool(false) -V8\SetObject(V8\Value)->IsObject(): bool(true) -V8\SetObject(V8\Value)->IsBoolean(): bool(false) -V8\SetObject(V8\Value)->IsNumber(): bool(false) -V8\SetObject(V8\Value)->IsInt32(): bool(false) -V8\SetObject(V8\Value)->IsUint32(): bool(false) -V8\SetObject(V8\Value)->IsDate(): bool(false) -V8\SetObject(V8\Value)->IsArgumentsObject(): bool(false) -V8\SetObject(V8\Value)->IsBooleanObject(): bool(false) -V8\SetObject(V8\Value)->IsNumberObject(): bool(false) -V8\SetObject(V8\Value)->IsStringObject(): bool(false) -V8\SetObject(V8\Value)->IsSymbolObject(): bool(false) -V8\SetObject(V8\Value)->IsNativeError(): bool(false) -V8\SetObject(V8\Value)->IsRegExp(): bool(false) -V8\SetObject(V8\Value)->IsAsyncFunction(): bool(false) -V8\SetObject(V8\Value)->IsGeneratorFunction(): bool(false) -V8\SetObject(V8\Value)->IsGeneratorObject(): bool(false) -V8\SetObject(V8\Value)->IsPromise(): bool(false) -V8\SetObject(V8\Value)->IsMap(): bool(false) -V8\SetObject(V8\Value)->IsSet(): bool(true) -V8\SetObject(V8\Value)->IsMapIterator(): bool(false) -V8\SetObject(V8\Value)->IsSetIterator(): bool(false) -V8\SetObject(V8\Value)->IsWeakMap(): bool(false) -V8\SetObject(V8\Value)->IsWeakSet(): bool(false) -V8\SetObject(V8\Value)->IsArrayBuffer(): bool(false) -V8\SetObject(V8\Value)->IsArrayBufferView(): bool(false) -V8\SetObject(V8\Value)->IsTypedArray(): bool(false) -V8\SetObject(V8\Value)->IsUint8Array(): bool(false) -V8\SetObject(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\SetObject(V8\Value)->IsInt8Array(): bool(false) -V8\SetObject(V8\Value)->IsUint16Array(): bool(false) -V8\SetObject(V8\Value)->IsInt16Array(): bool(false) -V8\SetObject(V8\Value)->IsUint32Array(): bool(false) -V8\SetObject(V8\Value)->IsInt32Array(): bool(false) -V8\SetObject(V8\Value)->IsFloat32Array(): bool(false) -V8\SetObject(V8\Value)->IsFloat64Array(): bool(false) -V8\SetObject(V8\Value)->IsDataView(): bool(false) -V8\SetObject(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\SetObject(V8\Value)->IsProxy(): bool(false) +V8\SetObject(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\SetObject(V8\ObjectValue)->isCallable(): bool(false) +V8\SetObject(V8\ObjectValue)->isConstructor(): bool(false) +V8\SetObject(V8\Value)->isUndefined(): bool(false) +V8\SetObject(V8\Value)->isNull(): bool(false) +V8\SetObject(V8\Value)->isNullOrUndefined(): bool(false) +V8\SetObject(V8\Value)->isTrue(): bool(false) +V8\SetObject(V8\Value)->isFalse(): bool(false) +V8\SetObject(V8\Value)->isName(): bool(false) +V8\SetObject(V8\Value)->isString(): bool(false) +V8\SetObject(V8\Value)->isSymbol(): bool(false) +V8\SetObject(V8\Value)->isFunction(): bool(false) +V8\SetObject(V8\Value)->isArray(): bool(false) +V8\SetObject(V8\Value)->isObject(): bool(true) +V8\SetObject(V8\Value)->isBoolean(): bool(false) +V8\SetObject(V8\Value)->isNumber(): bool(false) +V8\SetObject(V8\Value)->isInt32(): bool(false) +V8\SetObject(V8\Value)->isUint32(): bool(false) +V8\SetObject(V8\Value)->isDate(): bool(false) +V8\SetObject(V8\Value)->isArgumentsObject(): bool(false) +V8\SetObject(V8\Value)->isBooleanObject(): bool(false) +V8\SetObject(V8\Value)->isNumberObject(): bool(false) +V8\SetObject(V8\Value)->isStringObject(): bool(false) +V8\SetObject(V8\Value)->isSymbolObject(): bool(false) +V8\SetObject(V8\Value)->isNativeError(): bool(false) +V8\SetObject(V8\Value)->isRegExp(): bool(false) +V8\SetObject(V8\Value)->isAsyncFunction(): bool(false) +V8\SetObject(V8\Value)->isGeneratorFunction(): bool(false) +V8\SetObject(V8\Value)->isGeneratorObject(): bool(false) +V8\SetObject(V8\Value)->isPromise(): bool(false) +V8\SetObject(V8\Value)->isMap(): bool(false) +V8\SetObject(V8\Value)->isSet(): bool(true) +V8\SetObject(V8\Value)->isMapIterator(): bool(false) +V8\SetObject(V8\Value)->isSetIterator(): bool(false) +V8\SetObject(V8\Value)->isWeakMap(): bool(false) +V8\SetObject(V8\Value)->isWeakSet(): bool(false) +V8\SetObject(V8\Value)->isArrayBuffer(): bool(false) +V8\SetObject(V8\Value)->isArrayBufferView(): bool(false) +V8\SetObject(V8\Value)->isTypedArray(): bool(false) +V8\SetObject(V8\Value)->isUint8Array(): bool(false) +V8\SetObject(V8\Value)->isUint8ClampedArray(): bool(false) +V8\SetObject(V8\Value)->isInt8Array(): bool(false) +V8\SetObject(V8\Value)->isUint16Array(): bool(false) +V8\SetObject(V8\Value)->isInt16Array(): bool(false) +V8\SetObject(V8\Value)->isUint32Array(): bool(false) +V8\SetObject(V8\Value)->isInt32Array(): bool(false) +V8\SetObject(V8\Value)->isFloat32Array(): bool(false) +V8\SetObject(V8\Value)->isFloat64Array(): bool(false) +V8\SetObject(V8\Value)->isDataView(): bool(false) +V8\SetObject(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\SetObject(V8\Value)->isProxy(): bool(false) Converters: ----------- -V8\SetObject(V8\Value)->ToBoolean(): +V8\SetObject(V8\Value)->toBoolean(): object(V8\BooleanValue)#121 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\SetObject(V8\Value)->ToNumber(): +V8\SetObject(V8\Value)->toNumber(): object(V8\NumberValue)#121 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\SetObject(V8\Value)->ToString(): +V8\SetObject(V8\Value)->toString(): object(V8\StringValue)#121 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\SetObject(V8\Value)->ToDetailString(): +V8\SetObject(V8\Value)->toDetailString(): object(V8\StringValue)#121 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\SetObject(V8\Value)->ToObject(): +V8\SetObject(V8\Value)->toObject(): object(V8\SetObject)#6 (2) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { @@ -230,59 +230,59 @@ V8\SetObject(V8\Value)->ToObject(): } } } -V8\SetObject(V8\Value)->ToInteger(): +V8\SetObject(V8\Value)->toInteger(): object(V8\Int32Value)#121 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\SetObject(V8\Value)->ToUint32(): +V8\SetObject(V8\Value)->toUint32(): object(V8\Int32Value)#121 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\SetObject(V8\Value)->ToInt32(): +V8\SetObject(V8\Value)->toInt32(): object(V8\Int32Value)#121 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\SetObject(V8\Value)->ToArrayIndex(): V8\Exceptions\Exception: Failed to convert +V8\SetObject(V8\Value)->toArrayIndex(): V8\Exceptions\Exception: Failed to convert New value creation from V8 runtime: ----------------------------------- New set from V8 is instance of \V8\SetObject: ok -V8\SetObject(V8\Value)->IsObject(): bool(true) -V8\SetObject(V8\Value)->IsMap(): bool(false) -V8\SetObject(V8\Value)->IsSet(): bool(true) -V8\SetObject(V8\Value)->IsWeakMap(): bool(false) -V8\SetObject(V8\Value)->IsWeakSet(): bool(false) +V8\SetObject(V8\Value)->isObject(): bool(true) +V8\SetObject(V8\Value)->isMap(): bool(false) +V8\SetObject(V8\Value)->isSet(): bool(true) +V8\SetObject(V8\Value)->isWeakMap(): bool(false) +V8\SetObject(V8\Value)->isWeakSet(): bool(false) New weak set from V8 is NOT an instance of \V8\SetObject: ok -V8\ObjectValue(V8\Value)->IsObject(): bool(true) -V8\ObjectValue(V8\Value)->IsMap(): bool(false) -V8\ObjectValue(V8\Value)->IsSet(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakMap(): bool(false) -V8\ObjectValue(V8\Value)->IsWeakSet(): bool(true) +V8\ObjectValue(V8\Value)->isObject(): bool(true) +V8\ObjectValue(V8\Value)->isMap(): bool(false) +V8\ObjectValue(V8\Value)->isSet(): bool(false) +V8\ObjectValue(V8\Value)->isWeakMap(): bool(false) +V8\ObjectValue(V8\Value)->isWeakSet(): bool(true) Class-specific methods: ----------------------- -V8\SetObject->Size(): float(0) +V8\SetObject->size(): float(0) Can add key: ok Can add another different key: ok -V8\SetObject->Size(): float(2) +V8\SetObject->size(): float(2) Cannot add another same key: ok -V8\SetObject->Size(): float(2) +V8\SetObject->size(): float(2) Key exists: ok Another key exists: ok Nonexistent key does not exists: ok -V8\SetObject->Size(): float(2) -V8\SetObject::AsArray() result is instance of V8\ArrayObject +V8\SetObject->size(): float(2) +V8\SetObject::asArray() result is instance of V8\ArrayObject SetObject Array representation has valid length: ok SetObject Array contains key: ok @@ -292,8 +292,8 @@ Delete existent key: ok Deleted key does not exists: ok Delete nonexistent key fails: ok Deleted nonexistent key does not exists: ok -V8\SetObject->Size(): float(1) +V8\SetObject->size(): float(1) -V8\SetObject->Size(): float(3) -V8\SetObject->Clear(): NULL -V8\SetObject->Size(): float(0) +V8\SetObject->size(): float(3) +V8\SetObject->clear(): NULL +V8\SetObject->size(): float(0) diff --git a/tests/V8Source.phpt b/tests/V8Source.phpt index 84da352..c48538b 100644 --- a/tests/V8Source.phpt +++ b/tests/V8Source.phpt @@ -27,9 +27,9 @@ $helper->dump($value); $helper->space(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetSourceString', $source_string); -$helper->method_matches($value, 'GetCachedData', null); -$helper->method_matches($value, 'GetScriptOrigin', null); +$helper->method_matches($value, 'getSourceString', $source_string); +$helper->method_matches($value, 'getCachedData', null); +$helper->method_matches($value, 'getScriptOrigin', null); $helper->space(); @@ -40,9 +40,9 @@ $helper->dump($value); $helper->space(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetSourceString', $source_string); -$helper->method_matches($value, 'GetScriptOrigin', $origin); -$helper->method_matches($value, 'GetCachedData', null); +$helper->method_matches($value, 'getSourceString', $source_string); +$helper->method_matches($value, 'getScriptOrigin', $origin); +$helper->method_matches($value, 'getCachedData', null); $helper->space(); @@ -53,9 +53,9 @@ $helper->dump($value); $helper->space(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetSourceString', $source_string); -$helper->method_matches($value, 'GetScriptOrigin', null); -$helper->method_matches($value, 'GetCachedData', $cache_data); +$helper->method_matches($value, 'getSourceString', $source_string); +$helper->method_matches($value, 'getScriptOrigin', null); +$helper->method_matches($value, 'getCachedData', $cache_data); $helper->space(); $value = new \V8\ScriptCompiler\Source($source_string, $origin, $cache_data); @@ -65,9 +65,9 @@ $helper->dump($value); $helper->space(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetSourceString', $source_string); -$helper->method_matches($value, 'GetScriptOrigin', $origin); -$helper->method_matches($value, 'GetCachedData', $cache_data); +$helper->method_matches($value, 'getSourceString', $source_string); +$helper->method_matches($value, 'getScriptOrigin', $origin); +$helper->method_matches($value, 'getCachedData', $cache_data); $helper->space(); ?> @@ -90,9 +90,9 @@ object(V8\ScriptCompiler\Source)#8 (3) { Accessors: ---------- -V8\ScriptCompiler\Source::GetSourceString() matches expected value -V8\ScriptCompiler\Source::GetCachedData() matches expected value -V8\ScriptCompiler\Source::GetScriptOrigin() matches expected value +V8\ScriptCompiler\Source::getSourceString() matches expected value +V8\ScriptCompiler\Source::getCachedData() matches expected value +V8\ScriptCompiler\Source::getScriptOrigin() matches expected value Object representation: @@ -135,9 +135,9 @@ object(V8\ScriptCompiler\Source)#9 (3) { Accessors: ---------- -V8\ScriptCompiler\Source::GetSourceString() matches expected value -V8\ScriptCompiler\Source::GetScriptOrigin() matches expected value -V8\ScriptCompiler\Source::GetCachedData() matches expected value +V8\ScriptCompiler\Source::getSourceString() matches expected value +V8\ScriptCompiler\Source::getScriptOrigin() matches expected value +V8\ScriptCompiler\Source::getCachedData() matches expected value Object representation: @@ -159,9 +159,9 @@ object(V8\ScriptCompiler\Source)#8 (3) { Accessors: ---------- -V8\ScriptCompiler\Source::GetSourceString() matches expected value -V8\ScriptCompiler\Source::GetScriptOrigin() matches expected value -V8\ScriptCompiler\Source::GetCachedData() matches expected value +V8\ScriptCompiler\Source::getSourceString() matches expected value +V8\ScriptCompiler\Source::getScriptOrigin() matches expected value +V8\ScriptCompiler\Source::getCachedData() matches expected value Object representation: @@ -205,6 +205,6 @@ object(V8\ScriptCompiler\Source)#9 (3) { Accessors: ---------- -V8\ScriptCompiler\Source::GetSourceString() matches expected value -V8\ScriptCompiler\Source::GetScriptOrigin() matches expected value -V8\ScriptCompiler\Source::GetCachedData() matches expected value +V8\ScriptCompiler\Source::getSourceString() matches expected value +V8\ScriptCompiler\Source::getScriptOrigin() matches expected value +V8\ScriptCompiler\Source::getCachedData() matches expected value diff --git a/tests/V8StackFrame.phpt b/tests/V8StackFrame.phpt index f33ea68..217ea96 100644 --- a/tests/V8StackFrame.phpt +++ b/tests/V8StackFrame.phpt @@ -15,14 +15,14 @@ $helper->dump($obj); $helper->space(); $helper->header('Test getters (default)'); -$helper->method_matches_with_output($obj, 'GetLineNumber', V8\Message::kNoLineNumberInfo); -$helper->method_matches_with_output($obj, 'GetColumn', V8\Message::kNoColumnInfo); -$helper->method_matches_with_output($obj, 'GetScriptId', V8\Message::kNoScriptIdInfo); -$helper->method_matches_with_output($obj, 'GetScriptName', ''); -$helper->method_matches_with_output($obj, 'GetScriptNameOrSourceURL', ''); -$helper->method_matches_with_output($obj, 'GetFunctionName', ''); -$helper->method_matches_with_output($obj, 'IsEval', false); -$helper->method_matches_with_output($obj, 'IsConstructor', false); +$helper->method_matches_with_output($obj, 'getLineNumber', V8\Message::kNoLineNumberInfo); +$helper->method_matches_with_output($obj, 'getColumn', V8\Message::kNoColumnInfo); +$helper->method_matches_with_output($obj, 'getScriptId', V8\Message::kNoScriptIdInfo); +$helper->method_matches_with_output($obj, 'getScriptName', ''); +$helper->method_matches_with_output($obj, 'getScriptNameOrSourceURL', ''); +$helper->method_matches_with_output($obj, 'getFunctionName', ''); +$helper->method_matches_with_output($obj, 'isEval', false); +$helper->method_matches_with_output($obj, 'isConstructor', false); $helper->space(); @@ -34,14 +34,14 @@ $helper->dump($obj); $helper->space(); $helper->header('Test getters'); -$helper->method_matches_with_output($obj, 'GetLineNumber', 1); -$helper->method_matches_with_output($obj, 'GetColumn', 2); -$helper->method_matches_with_output($obj, 'GetScriptId', 3); -$helper->method_matches_with_output($obj, 'GetScriptName', 'script_name'); -$helper->method_matches_with_output($obj, 'GetScriptNameOrSourceURL', 'script_name_or_source_url'); -$helper->method_matches_with_output($obj, 'GetFunctionName', 'function_name'); -$helper->method_matches_with_output($obj, 'IsEval', true); -$helper->method_matches_with_output($obj, 'IsConstructor', true); +$helper->method_matches_with_output($obj, 'getLineNumber', 1); +$helper->method_matches_with_output($obj, 'getColumn', 2); +$helper->method_matches_with_output($obj, 'getScriptId', 3); +$helper->method_matches_with_output($obj, 'getScriptName', 'script_name'); +$helper->method_matches_with_output($obj, 'getScriptNameOrSourceURL', 'script_name_or_source_url'); +$helper->method_matches_with_output($obj, 'getFunctionName', 'function_name'); +$helper->method_matches_with_output($obj, 'isEval', true); +$helper->method_matches_with_output($obj, 'isConstructor', true); $helper->space(); ?> @@ -70,14 +70,14 @@ object(V8\StackFrame)#2 (8) { Test getters (default): ----------------------- -V8\StackFrame::GetLineNumber() matches expected 0 -V8\StackFrame::GetColumn() matches expected 0 -V8\StackFrame::GetScriptId() matches expected 0 -V8\StackFrame::GetScriptName() matches expected '' -V8\StackFrame::GetScriptNameOrSourceURL() matches expected '' -V8\StackFrame::GetFunctionName() matches expected '' -V8\StackFrame::IsEval() matches expected false -V8\StackFrame::IsConstructor() matches expected false +V8\StackFrame::getLineNumber() matches expected 0 +V8\StackFrame::getColumn() matches expected 0 +V8\StackFrame::getScriptId() matches expected 0 +V8\StackFrame::getScriptName() matches expected '' +V8\StackFrame::getScriptNameOrSourceURL() matches expected '' +V8\StackFrame::getFunctionName() matches expected '' +V8\StackFrame::isEval() matches expected false +V8\StackFrame::isConstructor() matches expected false Object representation: @@ -104,11 +104,11 @@ object(V8\StackFrame)#3 (8) { Test getters: ------------- -V8\StackFrame::GetLineNumber() matches expected 1 -V8\StackFrame::GetColumn() matches expected 2 -V8\StackFrame::GetScriptId() matches expected 3 -V8\StackFrame::GetScriptName() matches expected 'script_name' -V8\StackFrame::GetScriptNameOrSourceURL() matches expected 'script_name_or_source_url' -V8\StackFrame::GetFunctionName() matches expected 'function_name' -V8\StackFrame::IsEval() matches expected true -V8\StackFrame::IsConstructor() matches expected true +V8\StackFrame::getLineNumber() matches expected 1 +V8\StackFrame::getColumn() matches expected 2 +V8\StackFrame::getScriptId() matches expected 3 +V8\StackFrame::getScriptName() matches expected 'script_name' +V8\StackFrame::getScriptNameOrSourceURL() matches expected 'script_name_or_source_url' +V8\StackFrame::getFunctionName() matches expected 'function_name' +V8\StackFrame::isEval() matches expected true +V8\StackFrame::isConstructor() matches expected true diff --git a/tests/V8StackTrace.phpt b/tests/V8StackTrace.phpt index f9c1575..347bd06 100644 --- a/tests/V8StackTrace.phpt +++ b/tests/V8StackTrace.phpt @@ -33,9 +33,9 @@ $helper->space(); $helper->header('Test getters'); -$helper->method_matches($obj, 'GetFrames', $frames); -$helper->method_matches($obj, 'GetFrame', $frame_1, [0]); -$helper->method_matches_with_output($obj, 'GetFrameCount', 2); +$helper->method_matches($obj, 'getFrames', $frames); +$helper->method_matches($obj, 'getFrame', $frame_1, [0]); +$helper->method_matches_with_output($obj, 'getFrameCount', 2); $helper->space(); $obj = null; @@ -101,9 +101,9 @@ V8\StackTrace::MAX_FRAME_LIMIT = 1000 Test getters: ------------- -V8\StackTrace::GetFrames() matches expected value -V8\StackTrace::GetFrame() matches expected value -V8\StackTrace::GetFrameCount() matches expected 2 +V8\StackTrace::getFrames() matches expected value +V8\StackTrace::getFrame() matches expected value +V8\StackTrace::getFrameCount() matches expected 2 Context dies now! diff --git a/tests/V8StackTrace_CurrentStackTrace.phpt b/tests/V8StackTrace_currentStackTrace.phpt similarity index 91% rename from tests/V8StackTrace_CurrentStackTrace.phpt rename to tests/V8StackTrace_currentStackTrace.phpt index fc4f0f4..51dc3ab 100644 --- a/tests/V8StackTrace_CurrentStackTrace.phpt +++ b/tests/V8StackTrace_currentStackTrace.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\StackTrace::CurrentStackTrace() +V8\StackTrace::currentStackTrace() --SKIPIF-- --FILE-- @@ -19,25 +19,25 @@ $global_template = new v8Tests\TrackingDtors\ObjectTemplate($isolate); $stack_trace = null; $current_stack_trace_func_tpl = new \v8Tests\TrackingDtors\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $args) use ($v8_helper, &$stack_trace) { - $isolate = $args->GetIsolate(); - $context = $args->GetContext(); + $isolate = $args->getIsolate(); + $context = $args->getContext(); - if (count($args->Arguments())) { - $frame_limit = $args->Arguments()[0]->NumberValue($context); + if (count($args->arguments())) { + $frame_limit = $args->arguments()[0]->numberValue($context); } else { $frame_limit = 10; } - $stack_trace = \V8\StackTrace::CurrentStackTrace($isolate, $frame_limit); + $stack_trace = \V8\StackTrace::currentStackTrace($isolate, $frame_limit); - echo 'totally ', $stack_trace->GetFrameCount(), ' frames:', PHP_EOL; + echo 'totally ', $stack_trace->getFrameCount(), ' frames:', PHP_EOL; - $arr = $v8_helper->getStackTraceFramesAsArray($context, $stack_trace->GetFrames()); + $arr = $v8_helper->getStackTraceFramesAsArray($context, $stack_trace->getFrames()); - $args->GetReturnValue()->Set($arr); + $args->getReturnValue()->set($arr); }); -$global_template->Set(new \V8\StringValue($isolate, 'current_stack_trace'), $current_stack_trace_func_tpl); +$global_template->set(new \V8\StringValue($isolate, 'current_stack_trace'), $current_stack_trace_func_tpl); $context = new v8Tests\TrackingDtors\Context($isolate, $global_template); $v8_helper->injectConsoleLog($context); @@ -99,7 +99,7 @@ console.log(); $file_name = 'test.js'; $script = new v8Tests\TrackingDtors\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$res = $script->Run($context); +$res = $script->run($context); diff --git a/tests/V8StartupData_CreateFromSource.phpt b/tests/V8StartupData_createFromSource.phpt similarity index 74% rename from tests/V8StartupData_CreateFromSource.phpt rename to tests/V8StartupData_createFromSource.phpt index 815b41f..2552446 100644 --- a/tests/V8StartupData_CreateFromSource.phpt +++ b/tests/V8StartupData_createFromSource.phpt @@ -1,5 +1,5 @@ --TEST-- -V8\StartupData::CreateFromSource +V8\StartupData::createFromSource --SKIPIF-- --FILE-- @@ -9,16 +9,16 @@ V8\StartupData::CreateFromSource $helper = require '.testsuite.php'; $source = 'function test_snapshot() { return "hello, world";}'; -$data = V8\StartupData::CreateFromSource($source); +$data = V8\StartupData::createFromSource($source); $helper->header('Object representation'); $helper->dump($data); $helper->space(); -$helper->assert('Snapshot blob is large binary string', is_string($data->GetData()) && strlen($data->GetData()) > 400000); -$helper->assert('Snapshot raw_size is the same as binary_string length', $data->GetRawSize(), strlen($data->GetData())); -$helper->assert('Snapshot raw_size is the same as binary_string length', $data->GetRawSize(), strlen($data->GetData())); +$helper->assert('Snapshot blob is large binary string', is_string($data->getData()) && strlen($data->getData()) > 400000); +$helper->assert('Snapshot raw_size is the same as binary_string length', $data->getRawSize(), strlen($data->getData())); +$helper->assert('Snapshot raw_size is the same as binary_string length', $data->getRawSize(), strlen($data->getData())); $isolate = new \V8\Isolate($data); @@ -26,11 +26,11 @@ $data = null; $context = new \V8\Context($isolate); -$helper->assert('Context global is affected by snapshot blob', $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'test_snapshot'))->IsFunction()); +$helper->assert('Context global is affected by snapshot blob', $context->globalObject()->get($context, new \V8\StringValue($isolate, 'test_snapshot'))->isFunction()); try { - V8\StartupData::CreateFromSource(') bad +/^\\'); + V8\StartupData::createFromSource(') bad +/^\\'); $helper->assert('Unable to create startup data from bad source', false); } catch (Exception $e) { $helper->space(); diff --git a/tests/V8StringObject.phpt b/tests/V8StringObject.phpt index fd0c1fd..3eef85e 100644 --- a/tests/V8StringObject.phpt +++ b/tests/V8StringObject.phpt @@ -25,17 +25,17 @@ $helper->dump($value); $helper->space(); $helper->assert('StringObject extends ObjectValue', $value instanceof \V8\ObjectValue); -$helper->assert('StringObject is instanceof String', $value->InstanceOf($context, $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'String')))); +$helper->assert('StringObject is instanceof String', $value->instanceOf($context, $context->globalObject()->get($context, new \V8\StringValue($isolate, 'String')))); $helper->line(); $helper->header('Getters'); -$helper->method_export($value, 'ValueOf'); -$helper->method_export($value->ValueOf(), 'Value'); +$helper->method_export($value, 'valueOf'); +$helper->method_export($value->valueOf(), 'value'); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'val'), $value); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'val'), $value); $source = ' console.log("val: ", val); @@ -77,69 +77,69 @@ StringObject is instanceof String: ok Getters: -------- -V8\StringObject->ValueOf(): +V8\StringObject->valueOf(): object(V8\StringValue)#119 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { } } -V8\StringValue->Value(): string(11) "test string" +V8\StringValue->value(): string(11) "test string" Checkers: --------- -V8\StringObject(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\StringObject(V8\ObjectValue)->IsCallable(): bool(false) -V8\StringObject(V8\ObjectValue)->IsConstructor(): bool(false) -V8\StringObject(V8\Value)->IsUndefined(): bool(false) -V8\StringObject(V8\Value)->IsNull(): bool(false) -V8\StringObject(V8\Value)->IsNullOrUndefined(): bool(false) -V8\StringObject(V8\Value)->IsTrue(): bool(false) -V8\StringObject(V8\Value)->IsFalse(): bool(false) -V8\StringObject(V8\Value)->IsName(): bool(false) -V8\StringObject(V8\Value)->IsString(): bool(false) -V8\StringObject(V8\Value)->IsSymbol(): bool(false) -V8\StringObject(V8\Value)->IsFunction(): bool(false) -V8\StringObject(V8\Value)->IsArray(): bool(false) -V8\StringObject(V8\Value)->IsObject(): bool(true) -V8\StringObject(V8\Value)->IsBoolean(): bool(false) -V8\StringObject(V8\Value)->IsNumber(): bool(false) -V8\StringObject(V8\Value)->IsInt32(): bool(false) -V8\StringObject(V8\Value)->IsUint32(): bool(false) -V8\StringObject(V8\Value)->IsDate(): bool(false) -V8\StringObject(V8\Value)->IsArgumentsObject(): bool(false) -V8\StringObject(V8\Value)->IsBooleanObject(): bool(false) -V8\StringObject(V8\Value)->IsNumberObject(): bool(false) -V8\StringObject(V8\Value)->IsStringObject(): bool(true) -V8\StringObject(V8\Value)->IsSymbolObject(): bool(false) -V8\StringObject(V8\Value)->IsNativeError(): bool(false) -V8\StringObject(V8\Value)->IsRegExp(): bool(false) -V8\StringObject(V8\Value)->IsAsyncFunction(): bool(false) -V8\StringObject(V8\Value)->IsGeneratorFunction(): bool(false) -V8\StringObject(V8\Value)->IsGeneratorObject(): bool(false) -V8\StringObject(V8\Value)->IsPromise(): bool(false) -V8\StringObject(V8\Value)->IsMap(): bool(false) -V8\StringObject(V8\Value)->IsSet(): bool(false) -V8\StringObject(V8\Value)->IsMapIterator(): bool(false) -V8\StringObject(V8\Value)->IsSetIterator(): bool(false) -V8\StringObject(V8\Value)->IsWeakMap(): bool(false) -V8\StringObject(V8\Value)->IsWeakSet(): bool(false) -V8\StringObject(V8\Value)->IsArrayBuffer(): bool(false) -V8\StringObject(V8\Value)->IsArrayBufferView(): bool(false) -V8\StringObject(V8\Value)->IsTypedArray(): bool(false) -V8\StringObject(V8\Value)->IsUint8Array(): bool(false) -V8\StringObject(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\StringObject(V8\Value)->IsInt8Array(): bool(false) -V8\StringObject(V8\Value)->IsUint16Array(): bool(false) -V8\StringObject(V8\Value)->IsInt16Array(): bool(false) -V8\StringObject(V8\Value)->IsUint32Array(): bool(false) -V8\StringObject(V8\Value)->IsInt32Array(): bool(false) -V8\StringObject(V8\Value)->IsFloat32Array(): bool(false) -V8\StringObject(V8\Value)->IsFloat64Array(): bool(false) -V8\StringObject(V8\Value)->IsDataView(): bool(false) -V8\StringObject(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\StringObject(V8\Value)->IsProxy(): bool(false) +V8\StringObject(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\StringObject(V8\ObjectValue)->isCallable(): bool(false) +V8\StringObject(V8\ObjectValue)->isConstructor(): bool(false) +V8\StringObject(V8\Value)->isUndefined(): bool(false) +V8\StringObject(V8\Value)->isNull(): bool(false) +V8\StringObject(V8\Value)->isNullOrUndefined(): bool(false) +V8\StringObject(V8\Value)->isTrue(): bool(false) +V8\StringObject(V8\Value)->isFalse(): bool(false) +V8\StringObject(V8\Value)->isName(): bool(false) +V8\StringObject(V8\Value)->isString(): bool(false) +V8\StringObject(V8\Value)->isSymbol(): bool(false) +V8\StringObject(V8\Value)->isFunction(): bool(false) +V8\StringObject(V8\Value)->isArray(): bool(false) +V8\StringObject(V8\Value)->isObject(): bool(true) +V8\StringObject(V8\Value)->isBoolean(): bool(false) +V8\StringObject(V8\Value)->isNumber(): bool(false) +V8\StringObject(V8\Value)->isInt32(): bool(false) +V8\StringObject(V8\Value)->isUint32(): bool(false) +V8\StringObject(V8\Value)->isDate(): bool(false) +V8\StringObject(V8\Value)->isArgumentsObject(): bool(false) +V8\StringObject(V8\Value)->isBooleanObject(): bool(false) +V8\StringObject(V8\Value)->isNumberObject(): bool(false) +V8\StringObject(V8\Value)->isStringObject(): bool(true) +V8\StringObject(V8\Value)->isSymbolObject(): bool(false) +V8\StringObject(V8\Value)->isNativeError(): bool(false) +V8\StringObject(V8\Value)->isRegExp(): bool(false) +V8\StringObject(V8\Value)->isAsyncFunction(): bool(false) +V8\StringObject(V8\Value)->isGeneratorFunction(): bool(false) +V8\StringObject(V8\Value)->isGeneratorObject(): bool(false) +V8\StringObject(V8\Value)->isPromise(): bool(false) +V8\StringObject(V8\Value)->isMap(): bool(false) +V8\StringObject(V8\Value)->isSet(): bool(false) +V8\StringObject(V8\Value)->isMapIterator(): bool(false) +V8\StringObject(V8\Value)->isSetIterator(): bool(false) +V8\StringObject(V8\Value)->isWeakMap(): bool(false) +V8\StringObject(V8\Value)->isWeakSet(): bool(false) +V8\StringObject(V8\Value)->isArrayBuffer(): bool(false) +V8\StringObject(V8\Value)->isArrayBufferView(): bool(false) +V8\StringObject(V8\Value)->isTypedArray(): bool(false) +V8\StringObject(V8\Value)->isUint8Array(): bool(false) +V8\StringObject(V8\Value)->isUint8ClampedArray(): bool(false) +V8\StringObject(V8\Value)->isInt8Array(): bool(false) +V8\StringObject(V8\Value)->isUint16Array(): bool(false) +V8\StringObject(V8\Value)->isInt16Array(): bool(false) +V8\StringObject(V8\Value)->isUint32Array(): bool(false) +V8\StringObject(V8\Value)->isInt32Array(): bool(false) +V8\StringObject(V8\Value)->isFloat32Array(): bool(false) +V8\StringObject(V8\Value)->isFloat64Array(): bool(false) +V8\StringObject(V8\Value)->isDataView(): bool(false) +V8\StringObject(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\StringObject(V8\Value)->isProxy(): bool(false) val: test string @@ -153,55 +153,55 @@ Expected value is identical to actual value Checkers on boxed from script: ------------------------------ -V8\StringObject(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\StringObject(V8\ObjectValue)->IsCallable(): bool(false) -V8\StringObject(V8\ObjectValue)->IsConstructor(): bool(false) -V8\StringObject(V8\Value)->IsUndefined(): bool(false) -V8\StringObject(V8\Value)->IsNull(): bool(false) -V8\StringObject(V8\Value)->IsNullOrUndefined(): bool(false) -V8\StringObject(V8\Value)->IsTrue(): bool(false) -V8\StringObject(V8\Value)->IsFalse(): bool(false) -V8\StringObject(V8\Value)->IsName(): bool(false) -V8\StringObject(V8\Value)->IsString(): bool(false) -V8\StringObject(V8\Value)->IsSymbol(): bool(false) -V8\StringObject(V8\Value)->IsFunction(): bool(false) -V8\StringObject(V8\Value)->IsArray(): bool(false) -V8\StringObject(V8\Value)->IsObject(): bool(true) -V8\StringObject(V8\Value)->IsBoolean(): bool(false) -V8\StringObject(V8\Value)->IsNumber(): bool(false) -V8\StringObject(V8\Value)->IsInt32(): bool(false) -V8\StringObject(V8\Value)->IsUint32(): bool(false) -V8\StringObject(V8\Value)->IsDate(): bool(false) -V8\StringObject(V8\Value)->IsArgumentsObject(): bool(false) -V8\StringObject(V8\Value)->IsBooleanObject(): bool(false) -V8\StringObject(V8\Value)->IsNumberObject(): bool(false) -V8\StringObject(V8\Value)->IsStringObject(): bool(true) -V8\StringObject(V8\Value)->IsSymbolObject(): bool(false) -V8\StringObject(V8\Value)->IsNativeError(): bool(false) -V8\StringObject(V8\Value)->IsRegExp(): bool(false) -V8\StringObject(V8\Value)->IsAsyncFunction(): bool(false) -V8\StringObject(V8\Value)->IsGeneratorFunction(): bool(false) -V8\StringObject(V8\Value)->IsGeneratorObject(): bool(false) -V8\StringObject(V8\Value)->IsPromise(): bool(false) -V8\StringObject(V8\Value)->IsMap(): bool(false) -V8\StringObject(V8\Value)->IsSet(): bool(false) -V8\StringObject(V8\Value)->IsMapIterator(): bool(false) -V8\StringObject(V8\Value)->IsSetIterator(): bool(false) -V8\StringObject(V8\Value)->IsWeakMap(): bool(false) -V8\StringObject(V8\Value)->IsWeakSet(): bool(false) -V8\StringObject(V8\Value)->IsArrayBuffer(): bool(false) -V8\StringObject(V8\Value)->IsArrayBufferView(): bool(false) -V8\StringObject(V8\Value)->IsTypedArray(): bool(false) -V8\StringObject(V8\Value)->IsUint8Array(): bool(false) -V8\StringObject(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\StringObject(V8\Value)->IsInt8Array(): bool(false) -V8\StringObject(V8\Value)->IsUint16Array(): bool(false) -V8\StringObject(V8\Value)->IsInt16Array(): bool(false) -V8\StringObject(V8\Value)->IsUint32Array(): bool(false) -V8\StringObject(V8\Value)->IsInt32Array(): bool(false) -V8\StringObject(V8\Value)->IsFloat32Array(): bool(false) -V8\StringObject(V8\Value)->IsFloat64Array(): bool(false) -V8\StringObject(V8\Value)->IsDataView(): bool(false) -V8\StringObject(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\StringObject(V8\Value)->IsProxy(): bool(false) +V8\StringObject(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\StringObject(V8\ObjectValue)->isCallable(): bool(false) +V8\StringObject(V8\ObjectValue)->isConstructor(): bool(false) +V8\StringObject(V8\Value)->isUndefined(): bool(false) +V8\StringObject(V8\Value)->isNull(): bool(false) +V8\StringObject(V8\Value)->isNullOrUndefined(): bool(false) +V8\StringObject(V8\Value)->isTrue(): bool(false) +V8\StringObject(V8\Value)->isFalse(): bool(false) +V8\StringObject(V8\Value)->isName(): bool(false) +V8\StringObject(V8\Value)->isString(): bool(false) +V8\StringObject(V8\Value)->isSymbol(): bool(false) +V8\StringObject(V8\Value)->isFunction(): bool(false) +V8\StringObject(V8\Value)->isArray(): bool(false) +V8\StringObject(V8\Value)->isObject(): bool(true) +V8\StringObject(V8\Value)->isBoolean(): bool(false) +V8\StringObject(V8\Value)->isNumber(): bool(false) +V8\StringObject(V8\Value)->isInt32(): bool(false) +V8\StringObject(V8\Value)->isUint32(): bool(false) +V8\StringObject(V8\Value)->isDate(): bool(false) +V8\StringObject(V8\Value)->isArgumentsObject(): bool(false) +V8\StringObject(V8\Value)->isBooleanObject(): bool(false) +V8\StringObject(V8\Value)->isNumberObject(): bool(false) +V8\StringObject(V8\Value)->isStringObject(): bool(true) +V8\StringObject(V8\Value)->isSymbolObject(): bool(false) +V8\StringObject(V8\Value)->isNativeError(): bool(false) +V8\StringObject(V8\Value)->isRegExp(): bool(false) +V8\StringObject(V8\Value)->isAsyncFunction(): bool(false) +V8\StringObject(V8\Value)->isGeneratorFunction(): bool(false) +V8\StringObject(V8\Value)->isGeneratorObject(): bool(false) +V8\StringObject(V8\Value)->isPromise(): bool(false) +V8\StringObject(V8\Value)->isMap(): bool(false) +V8\StringObject(V8\Value)->isSet(): bool(false) +V8\StringObject(V8\Value)->isMapIterator(): bool(false) +V8\StringObject(V8\Value)->isSetIterator(): bool(false) +V8\StringObject(V8\Value)->isWeakMap(): bool(false) +V8\StringObject(V8\Value)->isWeakSet(): bool(false) +V8\StringObject(V8\Value)->isArrayBuffer(): bool(false) +V8\StringObject(V8\Value)->isArrayBufferView(): bool(false) +V8\StringObject(V8\Value)->isTypedArray(): bool(false) +V8\StringObject(V8\Value)->isUint8Array(): bool(false) +V8\StringObject(V8\Value)->isUint8ClampedArray(): bool(false) +V8\StringObject(V8\Value)->isInt8Array(): bool(false) +V8\StringObject(V8\Value)->isUint16Array(): bool(false) +V8\StringObject(V8\Value)->isInt16Array(): bool(false) +V8\StringObject(V8\Value)->isUint32Array(): bool(false) +V8\StringObject(V8\Value)->isInt32Array(): bool(false) +V8\StringObject(V8\Value)->isFloat32Array(): bool(false) +V8\StringObject(V8\Value)->isFloat64Array(): bool(false) +V8\StringObject(V8\Value)->isDataView(): bool(false) +V8\StringObject(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\StringObject(V8\Value)->isProxy(): bool(false) diff --git a/tests/V8StringValue.phpt b/tests/V8StringValue.phpt index 012514b..37b3f54 100644 --- a/tests/V8StringValue.phpt +++ b/tests/V8StringValue.phpt @@ -18,7 +18,7 @@ $isolate = new V8\Isolate(); $default = new V8\StringValue($isolate); $helper->header('Default constructor'); $helper->dump($default); -$helper->method_export($default, 'Value'); +$helper->method_export($default, 'value'); $helper->space(); @@ -33,18 +33,18 @@ $helper->assert('StringValue extends Value', $value instanceof \V8\Value); $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_export($value, 'Value'); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_export($value, 'value'); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); $helper->header('Getters'); -$helper->assert('GetIdentityHash is integer', gettype($value->GetIdentityHash()), 'integer'); -$helper->method_export($value, 'Length'); -$helper->method_export($value, 'Utf8Length'); -$helper->method_export($value, 'IsOneByte'); -$helper->method_export($value, 'ContainsOnlyOneByte'); +$helper->assert('GetIdentityHash is integer', gettype($value->getIdentityHash()), 'integer'); +$helper->method_export($value, 'length'); +$helper->method_export($value, 'utf8Length'); +$helper->method_export($value, 'isOneByte'); +$helper->method_export($value, 'containsOnlyOneByte'); $helper->space(); $global_template = new \V8\ObjectTemplate($isolate); @@ -52,25 +52,25 @@ $context = new \V8\Context($isolate, $global_template); $helper->header('Primitive converters'); -$helper->method_export($value, 'BooleanValue', [$context]); -$helper->method_export($value, 'NumberValue', [$context]); +$helper->method_export($value, 'booleanValue', [$context]); +$helper->method_export($value, 'numberValue', [$context]); $helper->space(); $value = new V8\StringValue($isolate, ''); $helper->header('Test empty string constructor'); -$helper->method_export($value, 'Value'); -$helper->method_export($value, 'BooleanValue', [$context]); -$helper->method_export($value, 'NumberValue', [$context]); +$helper->method_export($value, 'value'); +$helper->method_export($value, 'booleanValue', [$context]); +$helper->method_export($value, 'numberValue', [$context]); $helper->space(); $value = new V8\StringValue($isolate); $helper->header('Test default constructor'); -$helper->method_export($value, 'Value'); -$helper->method_export($value, 'BooleanValue', [$context]); -$helper->method_export($value, 'NumberValue', [$context]); +$helper->method_export($value, 'value'); +$helper->method_export($value, 'booleanValue', [$context]); +$helper->method_export($value, 'numberValue', [$context]); $helper->space(); @@ -79,13 +79,13 @@ $helper->header('Test encodings'); foreach (['Hello, world!', 'Привет, мир!', 'こんにちは世界'] as $text ) { $value = new V8\StringValue($isolate, $text); - $helper->method_export($value, 'Value'); - $helper->method_export($value, 'Length'); - $helper->method_export($value, 'Utf8Length'); - $helper->method_export($value, 'IsOneByte'); - $helper->method_export($value, 'ContainsOnlyOneByte'); + $helper->method_export($value, 'value'); + $helper->method_export($value, 'length'); + $helper->method_export($value, 'utf8Length'); + $helper->method_export($value, 'isOneByte'); + $helper->method_export($value, 'containsOnlyOneByte'); - $helper->function_export('strlen', [$value->Value()]); + $helper->function_export('strlen', [$value->value()]); $helper->space(); } @@ -99,7 +99,7 @@ object(V8\StringValue)#4 (1) { object(V8\Isolate)#3 (0) { } } -V8\StringValue->Value(): string(0) "" +V8\StringValue->value(): string(0) "" Object representation: @@ -116,115 +116,115 @@ StringValue extends Value: ok Accessors: ---------- -V8\StringValue::GetIsolate() matches expected value -V8\StringValue->Value(): string(11) "test string" +V8\StringValue::getIsolate() matches expected value +V8\StringValue->value(): string(11) "test string" Checkers: --------- -V8\StringValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "string" - -V8\StringValue->IsOneByte(): bool(true) -V8\StringValue(V8\Value)->IsUndefined(): bool(false) -V8\StringValue(V8\Value)->IsNull(): bool(false) -V8\StringValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\StringValue(V8\Value)->IsTrue(): bool(false) -V8\StringValue(V8\Value)->IsFalse(): bool(false) -V8\StringValue(V8\Value)->IsName(): bool(true) -V8\StringValue(V8\Value)->IsString(): bool(true) -V8\StringValue(V8\Value)->IsSymbol(): bool(false) -V8\StringValue(V8\Value)->IsFunction(): bool(false) -V8\StringValue(V8\Value)->IsArray(): bool(false) -V8\StringValue(V8\Value)->IsObject(): bool(false) -V8\StringValue(V8\Value)->IsBoolean(): bool(false) -V8\StringValue(V8\Value)->IsNumber(): bool(false) -V8\StringValue(V8\Value)->IsInt32(): bool(false) -V8\StringValue(V8\Value)->IsUint32(): bool(false) -V8\StringValue(V8\Value)->IsDate(): bool(false) -V8\StringValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\StringValue(V8\Value)->IsBooleanObject(): bool(false) -V8\StringValue(V8\Value)->IsNumberObject(): bool(false) -V8\StringValue(V8\Value)->IsStringObject(): bool(false) -V8\StringValue(V8\Value)->IsSymbolObject(): bool(false) -V8\StringValue(V8\Value)->IsNativeError(): bool(false) -V8\StringValue(V8\Value)->IsRegExp(): bool(false) -V8\StringValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\StringValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\StringValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\StringValue(V8\Value)->IsPromise(): bool(false) -V8\StringValue(V8\Value)->IsMap(): bool(false) -V8\StringValue(V8\Value)->IsSet(): bool(false) -V8\StringValue(V8\Value)->IsMapIterator(): bool(false) -V8\StringValue(V8\Value)->IsSetIterator(): bool(false) -V8\StringValue(V8\Value)->IsWeakMap(): bool(false) -V8\StringValue(V8\Value)->IsWeakSet(): bool(false) -V8\StringValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\StringValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\StringValue(V8\Value)->IsTypedArray(): bool(false) -V8\StringValue(V8\Value)->IsUint8Array(): bool(false) -V8\StringValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\StringValue(V8\Value)->IsInt8Array(): bool(false) -V8\StringValue(V8\Value)->IsUint16Array(): bool(false) -V8\StringValue(V8\Value)->IsInt16Array(): bool(false) -V8\StringValue(V8\Value)->IsUint32Array(): bool(false) -V8\StringValue(V8\Value)->IsInt32Array(): bool(false) -V8\StringValue(V8\Value)->IsFloat32Array(): bool(false) -V8\StringValue(V8\Value)->IsFloat64Array(): bool(false) -V8\StringValue(V8\Value)->IsDataView(): bool(false) -V8\StringValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\StringValue(V8\Value)->IsProxy(): bool(false) +V8\StringValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "string" + +V8\StringValue->isOneByte(): bool(true) +V8\StringValue(V8\Value)->isUndefined(): bool(false) +V8\StringValue(V8\Value)->isNull(): bool(false) +V8\StringValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\StringValue(V8\Value)->isTrue(): bool(false) +V8\StringValue(V8\Value)->isFalse(): bool(false) +V8\StringValue(V8\Value)->isName(): bool(true) +V8\StringValue(V8\Value)->isString(): bool(true) +V8\StringValue(V8\Value)->isSymbol(): bool(false) +V8\StringValue(V8\Value)->isFunction(): bool(false) +V8\StringValue(V8\Value)->isArray(): bool(false) +V8\StringValue(V8\Value)->isObject(): bool(false) +V8\StringValue(V8\Value)->isBoolean(): bool(false) +V8\StringValue(V8\Value)->isNumber(): bool(false) +V8\StringValue(V8\Value)->isInt32(): bool(false) +V8\StringValue(V8\Value)->isUint32(): bool(false) +V8\StringValue(V8\Value)->isDate(): bool(false) +V8\StringValue(V8\Value)->isArgumentsObject(): bool(false) +V8\StringValue(V8\Value)->isBooleanObject(): bool(false) +V8\StringValue(V8\Value)->isNumberObject(): bool(false) +V8\StringValue(V8\Value)->isStringObject(): bool(false) +V8\StringValue(V8\Value)->isSymbolObject(): bool(false) +V8\StringValue(V8\Value)->isNativeError(): bool(false) +V8\StringValue(V8\Value)->isRegExp(): bool(false) +V8\StringValue(V8\Value)->isAsyncFunction(): bool(false) +V8\StringValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\StringValue(V8\Value)->isGeneratorObject(): bool(false) +V8\StringValue(V8\Value)->isPromise(): bool(false) +V8\StringValue(V8\Value)->isMap(): bool(false) +V8\StringValue(V8\Value)->isSet(): bool(false) +V8\StringValue(V8\Value)->isMapIterator(): bool(false) +V8\StringValue(V8\Value)->isSetIterator(): bool(false) +V8\StringValue(V8\Value)->isWeakMap(): bool(false) +V8\StringValue(V8\Value)->isWeakSet(): bool(false) +V8\StringValue(V8\Value)->isArrayBuffer(): bool(false) +V8\StringValue(V8\Value)->isArrayBufferView(): bool(false) +V8\StringValue(V8\Value)->isTypedArray(): bool(false) +V8\StringValue(V8\Value)->isUint8Array(): bool(false) +V8\StringValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\StringValue(V8\Value)->isInt8Array(): bool(false) +V8\StringValue(V8\Value)->isUint16Array(): bool(false) +V8\StringValue(V8\Value)->isInt16Array(): bool(false) +V8\StringValue(V8\Value)->isUint32Array(): bool(false) +V8\StringValue(V8\Value)->isInt32Array(): bool(false) +V8\StringValue(V8\Value)->isFloat32Array(): bool(false) +V8\StringValue(V8\Value)->isFloat64Array(): bool(false) +V8\StringValue(V8\Value)->isDataView(): bool(false) +V8\StringValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\StringValue(V8\Value)->isProxy(): bool(false) Getters: -------- GetIdentityHash is integer: ok -V8\StringValue->Length(): int(11) -V8\StringValue->Utf8Length(): int(11) -V8\StringValue->IsOneByte(): bool(true) -V8\StringValue->ContainsOnlyOneByte(): bool(true) +V8\StringValue->length(): int(11) +V8\StringValue->utf8Length(): int(11) +V8\StringValue->isOneByte(): bool(true) +V8\StringValue->containsOnlyOneByte(): bool(true) Primitive converters: --------------------- -V8\StringValue(V8\Value)->BooleanValue(): bool(true) -V8\StringValue(V8\Value)->NumberValue(): float(NAN) +V8\StringValue(V8\Value)->booleanValue(): bool(true) +V8\StringValue(V8\Value)->numberValue(): float(NAN) Test empty string constructor: ------------------------------ -V8\StringValue->Value(): string(0) "" -V8\StringValue(V8\Value)->BooleanValue(): bool(false) -V8\StringValue(V8\Value)->NumberValue(): float(0) +V8\StringValue->value(): string(0) "" +V8\StringValue(V8\Value)->booleanValue(): bool(false) +V8\StringValue(V8\Value)->numberValue(): float(0) Test default constructor: ------------------------- -V8\StringValue->Value(): string(0) "" -V8\StringValue(V8\Value)->BooleanValue(): bool(false) -V8\StringValue(V8\Value)->NumberValue(): float(0) +V8\StringValue->value(): string(0) "" +V8\StringValue(V8\Value)->booleanValue(): bool(false) +V8\StringValue(V8\Value)->numberValue(): float(0) Test encodings: --------------- -V8\StringValue->Value(): string(13) "Hello, world!" -V8\StringValue->Length(): int(13) -V8\StringValue->Utf8Length(): int(13) -V8\StringValue->IsOneByte(): bool(true) -V8\StringValue->ContainsOnlyOneByte(): bool(true) +V8\StringValue->value(): string(13) "Hello, world!" +V8\StringValue->length(): int(13) +V8\StringValue->utf8Length(): int(13) +V8\StringValue->isOneByte(): bool(true) +V8\StringValue->containsOnlyOneByte(): bool(true) strlen(): 13 -V8\StringValue->Value(): string(21) "Привет, мир!" -V8\StringValue->Length(): int(12) -V8\StringValue->Utf8Length(): int(21) -V8\StringValue->IsOneByte(): bool(false) -V8\StringValue->ContainsOnlyOneByte(): bool(false) +V8\StringValue->value(): string(21) "Привет, мир!" +V8\StringValue->length(): int(12) +V8\StringValue->utf8Length(): int(21) +V8\StringValue->isOneByte(): bool(false) +V8\StringValue->containsOnlyOneByte(): bool(false) strlen(): 21 -V8\StringValue->Value(): string(21) "こんにちは世界" -V8\StringValue->Length(): int(7) -V8\StringValue->Utf8Length(): int(21) -V8\StringValue->IsOneByte(): bool(false) -V8\StringValue->ContainsOnlyOneByte(): bool(false) +V8\StringValue->value(): string(21) "こんにちは世界" +V8\StringValue->length(): int(7) +V8\StringValue->utf8Length(): int(21) +V8\StringValue->isOneByte(): bool(false) +V8\StringValue->containsOnlyOneByte(): bool(false) strlen(): 21 diff --git a/tests/V8SymbolObject.phpt b/tests/V8SymbolObject.phpt index fed97f5..30e568a 100644 --- a/tests/V8SymbolObject.phpt +++ b/tests/V8SymbolObject.phpt @@ -28,17 +28,17 @@ $helper->dump($value); $helper->space(); $helper->assert('SymbolObject extends ObjectValue', $value instanceof \V8\ObjectValue); -$helper->assert('SymbolObject is instanceof Symbol', $value->InstanceOf($context, $context->GlobalObject()->Get($context, new \V8\StringValue($isolate, 'Symbol')))); +$helper->assert('SymbolObject is instanceof Symbol', $value->instanceOf($context, $context->globalObject()->get($context, new \V8\StringValue($isolate, 'Symbol')))); $helper->line(); $helper->header('Getters'); -$helper->method_export($value, 'ValueOf'); -$helper->pretty_dump('Symbol name:', $value->ValueOf()->Name()->Value()); +$helper->method_export($value, 'valueOf'); +$helper->pretty_dump('Symbol name:', $value->valueOf()->name()->value()); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'val'), $value); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'val'), $value); $source = ' console.log("val: ", val); @@ -84,7 +84,7 @@ SymbolObject is instanceof Symbol: ok Getters: -------- -V8\SymbolObject->ValueOf(): +V8\SymbolObject->valueOf(): object(V8\SymbolValue)#119 (1) { ["isolate":"V8\Value":private]=> object(V8\Isolate)#3 (0) { @@ -95,58 +95,58 @@ Symbol name:: string(4) "test" Checkers: --------- -V8\SymbolObject(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "object" - -V8\SymbolObject(V8\ObjectValue)->IsCallable(): bool(false) -V8\SymbolObject(V8\ObjectValue)->IsConstructor(): bool(false) -V8\SymbolObject(V8\Value)->IsUndefined(): bool(false) -V8\SymbolObject(V8\Value)->IsNull(): bool(false) -V8\SymbolObject(V8\Value)->IsNullOrUndefined(): bool(false) -V8\SymbolObject(V8\Value)->IsTrue(): bool(false) -V8\SymbolObject(V8\Value)->IsFalse(): bool(false) -V8\SymbolObject(V8\Value)->IsName(): bool(false) -V8\SymbolObject(V8\Value)->IsString(): bool(false) -V8\SymbolObject(V8\Value)->IsSymbol(): bool(false) -V8\SymbolObject(V8\Value)->IsFunction(): bool(false) -V8\SymbolObject(V8\Value)->IsArray(): bool(false) -V8\SymbolObject(V8\Value)->IsObject(): bool(true) -V8\SymbolObject(V8\Value)->IsBoolean(): bool(false) -V8\SymbolObject(V8\Value)->IsNumber(): bool(false) -V8\SymbolObject(V8\Value)->IsInt32(): bool(false) -V8\SymbolObject(V8\Value)->IsUint32(): bool(false) -V8\SymbolObject(V8\Value)->IsDate(): bool(false) -V8\SymbolObject(V8\Value)->IsArgumentsObject(): bool(false) -V8\SymbolObject(V8\Value)->IsBooleanObject(): bool(false) -V8\SymbolObject(V8\Value)->IsNumberObject(): bool(false) -V8\SymbolObject(V8\Value)->IsStringObject(): bool(false) -V8\SymbolObject(V8\Value)->IsSymbolObject(): bool(true) -V8\SymbolObject(V8\Value)->IsNativeError(): bool(false) -V8\SymbolObject(V8\Value)->IsRegExp(): bool(false) -V8\SymbolObject(V8\Value)->IsAsyncFunction(): bool(false) -V8\SymbolObject(V8\Value)->IsGeneratorFunction(): bool(false) -V8\SymbolObject(V8\Value)->IsGeneratorObject(): bool(false) -V8\SymbolObject(V8\Value)->IsPromise(): bool(false) -V8\SymbolObject(V8\Value)->IsMap(): bool(false) -V8\SymbolObject(V8\Value)->IsSet(): bool(false) -V8\SymbolObject(V8\Value)->IsMapIterator(): bool(false) -V8\SymbolObject(V8\Value)->IsSetIterator(): bool(false) -V8\SymbolObject(V8\Value)->IsWeakMap(): bool(false) -V8\SymbolObject(V8\Value)->IsWeakSet(): bool(false) -V8\SymbolObject(V8\Value)->IsArrayBuffer(): bool(false) -V8\SymbolObject(V8\Value)->IsArrayBufferView(): bool(false) -V8\SymbolObject(V8\Value)->IsTypedArray(): bool(false) -V8\SymbolObject(V8\Value)->IsUint8Array(): bool(false) -V8\SymbolObject(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\SymbolObject(V8\Value)->IsInt8Array(): bool(false) -V8\SymbolObject(V8\Value)->IsUint16Array(): bool(false) -V8\SymbolObject(V8\Value)->IsInt16Array(): bool(false) -V8\SymbolObject(V8\Value)->IsUint32Array(): bool(false) -V8\SymbolObject(V8\Value)->IsInt32Array(): bool(false) -V8\SymbolObject(V8\Value)->IsFloat32Array(): bool(false) -V8\SymbolObject(V8\Value)->IsFloat64Array(): bool(false) -V8\SymbolObject(V8\Value)->IsDataView(): bool(false) -V8\SymbolObject(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\SymbolObject(V8\Value)->IsProxy(): bool(false) +V8\SymbolObject(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "object" + +V8\SymbolObject(V8\ObjectValue)->isCallable(): bool(false) +V8\SymbolObject(V8\ObjectValue)->isConstructor(): bool(false) +V8\SymbolObject(V8\Value)->isUndefined(): bool(false) +V8\SymbolObject(V8\Value)->isNull(): bool(false) +V8\SymbolObject(V8\Value)->isNullOrUndefined(): bool(false) +V8\SymbolObject(V8\Value)->isTrue(): bool(false) +V8\SymbolObject(V8\Value)->isFalse(): bool(false) +V8\SymbolObject(V8\Value)->isName(): bool(false) +V8\SymbolObject(V8\Value)->isString(): bool(false) +V8\SymbolObject(V8\Value)->isSymbol(): bool(false) +V8\SymbolObject(V8\Value)->isFunction(): bool(false) +V8\SymbolObject(V8\Value)->isArray(): bool(false) +V8\SymbolObject(V8\Value)->isObject(): bool(true) +V8\SymbolObject(V8\Value)->isBoolean(): bool(false) +V8\SymbolObject(V8\Value)->isNumber(): bool(false) +V8\SymbolObject(V8\Value)->isInt32(): bool(false) +V8\SymbolObject(V8\Value)->isUint32(): bool(false) +V8\SymbolObject(V8\Value)->isDate(): bool(false) +V8\SymbolObject(V8\Value)->isArgumentsObject(): bool(false) +V8\SymbolObject(V8\Value)->isBooleanObject(): bool(false) +V8\SymbolObject(V8\Value)->isNumberObject(): bool(false) +V8\SymbolObject(V8\Value)->isStringObject(): bool(false) +V8\SymbolObject(V8\Value)->isSymbolObject(): bool(true) +V8\SymbolObject(V8\Value)->isNativeError(): bool(false) +V8\SymbolObject(V8\Value)->isRegExp(): bool(false) +V8\SymbolObject(V8\Value)->isAsyncFunction(): bool(false) +V8\SymbolObject(V8\Value)->isGeneratorFunction(): bool(false) +V8\SymbolObject(V8\Value)->isGeneratorObject(): bool(false) +V8\SymbolObject(V8\Value)->isPromise(): bool(false) +V8\SymbolObject(V8\Value)->isMap(): bool(false) +V8\SymbolObject(V8\Value)->isSet(): bool(false) +V8\SymbolObject(V8\Value)->isMapIterator(): bool(false) +V8\SymbolObject(V8\Value)->isSetIterator(): bool(false) +V8\SymbolObject(V8\Value)->isWeakMap(): bool(false) +V8\SymbolObject(V8\Value)->isWeakSet(): bool(false) +V8\SymbolObject(V8\Value)->isArrayBuffer(): bool(false) +V8\SymbolObject(V8\Value)->isArrayBufferView(): bool(false) +V8\SymbolObject(V8\Value)->isTypedArray(): bool(false) +V8\SymbolObject(V8\Value)->isUint8Array(): bool(false) +V8\SymbolObject(V8\Value)->isUint8ClampedArray(): bool(false) +V8\SymbolObject(V8\Value)->isInt8Array(): bool(false) +V8\SymbolObject(V8\Value)->isUint16Array(): bool(false) +V8\SymbolObject(V8\Value)->isInt16Array(): bool(false) +V8\SymbolObject(V8\Value)->isUint32Array(): bool(false) +V8\SymbolObject(V8\Value)->isInt32Array(): bool(false) +V8\SymbolObject(V8\Value)->isFloat32Array(): bool(false) +V8\SymbolObject(V8\Value)->isFloat64Array(): bool(false) +V8\SymbolObject(V8\Value)->isDataView(): bool(false) +V8\SymbolObject(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\SymbolObject(V8\Value)->isProxy(): bool(false) val: {Symbol object: test} diff --git a/tests/V8SymbolValue.phpt b/tests/V8SymbolValue.phpt index 13b2495..b0b287b 100644 --- a/tests/V8SymbolValue.phpt +++ b/tests/V8SymbolValue.phpt @@ -29,10 +29,10 @@ $helper->assert('SymbolValue extends Value', $value instanceof \V8\Value); $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_export($value, 'Value'); -$helper->assert('Name() is undefined', $value->Name() instanceof \V8\UndefinedValue); -$helper->assert('GetIdentityHash is integer', gettype($value->GetIdentityHash()), 'integer'); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_export($value, 'value'); +$helper->assert('Name() is undefined', $value->name() instanceof \V8\UndefinedValue); +$helper->assert('GetIdentityHash is integer', gettype($value->getIdentityHash()), 'integer'); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); @@ -50,10 +50,10 @@ $helper->assert('SymbolValue extends NameValue', $value instanceof \V8\NameValue $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_export($value, 'Value'); -$helper->assert('Name() is undefined', $value->Name() instanceof \V8\UndefinedValue); -$helper->assert('GetIdentityHash is integer', gettype($value->GetIdentityHash()), 'integer'); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_export($value, 'value'); +$helper->assert('Name() is undefined', $value->name() instanceof \V8\UndefinedValue); +$helper->assert('GetIdentityHash is integer', gettype($value->getIdentityHash()), 'integer'); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); @@ -70,16 +70,16 @@ $helper->assert('SymbolValue extends NameValue', $value instanceof \V8\NameValue $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_export($value, 'Value'); -$helper->assert('Name() is String', $value->Name() instanceof \V8\StringValue); -$helper->assert('GetIdentityHash is integer', gettype($value->GetIdentityHash()), 'integer'); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_export($value, 'value'); +$helper->assert('Name() is String', $value->name() instanceof \V8\StringValue); +$helper->assert('GetIdentityHash is integer', gettype($value->getIdentityHash()), 'integer'); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); $helper->header('Symbol name'); -$helper->dump($value->Name()->Value()); +$helper->dump($value->name()->value()); $helper->line(); @@ -95,19 +95,19 @@ $helper->assert('SymbolValue extends NameValue', $value instanceof \V8\NameValue $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_export($value, 'Value'); -$helper->assert('Name() is String', $value->Name() instanceof \V8\StringValue); -$helper->assert('GetIdentityHash is integer', gettype($value->GetIdentityHash()), 'integer'); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_export($value, 'value'); +$helper->assert('Name() is String', $value->name() instanceof \V8\StringValue); +$helper->assert('GetIdentityHash is integer', gettype($value->getIdentityHash()), 'integer'); $helper->space(); $v8_helper->run_checks($value, 'Checkers'); $helper->header('Symbol name'); -$helper->dump($value->Name()->Value()); +$helper->dump($value->name()->value()); $helper->line(); -$v8_helper->run_checks($value->Name(), 'Checkers on name'); +$v8_helper->run_checks($value->name(), 'Checkers on name'); $source = 'Symbol("foo")'; @@ -121,15 +121,15 @@ $v8_helper->run_checks($res, 'Checkers on Symbol value from script'); function test_For(\V8\Context $context, PhpV8Testsuite $helper) { - $value = V8\SymbolValue::For($context, new \V8\StringValue($context->GetIsolate(), 'test')); + $value = V8\SymbolValue::for($context, new \V8\StringValue($context->getIsolate(), 'test')); $helper->assert('Symbol For(string) returned', $value instanceof \V8\SymbolValue); - $helper->pretty_dump('Symbol For(string) name', $value->Name()->Value()); + $helper->pretty_dump('Symbol For(string) name', $value->name()->value()); $helper->line(); } function getFunctionForTesting(\V8\Context $context, PhpV8Testsuite $helper, callable $fnc, array $extra_args = []) { return new \V8\FunctionObject($context, function (\V8\FunctionCallbackInfo $args) use ($helper, $fnc) { - $fnc($args->GetContext(), $helper); + $fnc($args->getContext(), $helper); }); } @@ -139,14 +139,14 @@ try { $helper->exception_export($e); } -$context->GlobalObject()->Set($context, new \V8\StringValue($isolate, 'test_For'), getFunctionForTesting($context, $helper, 'test_For')); +$context->globalObject()->set($context, new \V8\StringValue($isolate, 'test_For'), getFunctionForTesting($context, $helper, 'test_For')); $v8_helper->CompileRun($context, 'test_For()'); -$helper->assert('Isolate not in context', !$isolate->InContext()); -$value = V8\SymbolValue::ForApi($context, new \V8\StringValue($isolate, 'test')); +$helper->assert('Isolate not in context', !$isolate->inContext()); +$value = V8\SymbolValue::forApi($context, new \V8\StringValue($isolate, 'test')); $helper->assert('Symbol ForApi(string) returned', $value instanceof \V8\SymbolValue); -$helper->pretty_dump('Symbol ForApi(string) name', $value->Name()->Value()); +$helper->pretty_dump('Symbol ForApi(string) name', $value->name()->value()); $helper->line(); $static_getters = [ @@ -163,10 +163,10 @@ $static_getters = [ ]; foreach ($static_getters as $static_getter) { - $helper->assert('Isolate not in context', !$isolate->InContext()); + $helper->assert('Isolate not in context', !$isolate->inContext()); $value = V8\SymbolValue::$static_getter($isolate); $helper->assert("Symbol {$static_getter}() returned", $value instanceof \V8\SymbolValue); - $helper->pretty_dump("Symbol {$static_getter}() name", $value->Name()->Value()); + $helper->pretty_dump("Symbol {$static_getter}() name", $value->Name()->value()); $helper->line(); } @@ -189,64 +189,64 @@ SymbolValue extends Value: ok Accessors: ---------- -V8\SymbolValue::GetIsolate() matches expected value -V8\SymbolValue->Value(): string(0) "" +V8\SymbolValue::getIsolate() matches expected value +V8\SymbolValue->value(): string(0) "" Name() is undefined: ok GetIdentityHash is integer: ok Checkers: --------- -V8\SymbolValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "symbol" - -V8\SymbolValue(V8\Value)->IsUndefined(): bool(false) -V8\SymbolValue(V8\Value)->IsNull(): bool(false) -V8\SymbolValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\SymbolValue(V8\Value)->IsTrue(): bool(false) -V8\SymbolValue(V8\Value)->IsFalse(): bool(false) -V8\SymbolValue(V8\Value)->IsName(): bool(true) -V8\SymbolValue(V8\Value)->IsString(): bool(false) -V8\SymbolValue(V8\Value)->IsSymbol(): bool(true) -V8\SymbolValue(V8\Value)->IsFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsArray(): bool(false) -V8\SymbolValue(V8\Value)->IsObject(): bool(false) -V8\SymbolValue(V8\Value)->IsBoolean(): bool(false) -V8\SymbolValue(V8\Value)->IsNumber(): bool(false) -V8\SymbolValue(V8\Value)->IsInt32(): bool(false) -V8\SymbolValue(V8\Value)->IsUint32(): bool(false) -V8\SymbolValue(V8\Value)->IsDate(): bool(false) -V8\SymbolValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\SymbolValue(V8\Value)->IsBooleanObject(): bool(false) -V8\SymbolValue(V8\Value)->IsNumberObject(): bool(false) -V8\SymbolValue(V8\Value)->IsStringObject(): bool(false) -V8\SymbolValue(V8\Value)->IsSymbolObject(): bool(false) -V8\SymbolValue(V8\Value)->IsNativeError(): bool(false) -V8\SymbolValue(V8\Value)->IsRegExp(): bool(false) -V8\SymbolValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\SymbolValue(V8\Value)->IsPromise(): bool(false) -V8\SymbolValue(V8\Value)->IsMap(): bool(false) -V8\SymbolValue(V8\Value)->IsSet(): bool(false) -V8\SymbolValue(V8\Value)->IsMapIterator(): bool(false) -V8\SymbolValue(V8\Value)->IsSetIterator(): bool(false) -V8\SymbolValue(V8\Value)->IsWeakMap(): bool(false) -V8\SymbolValue(V8\Value)->IsWeakSet(): bool(false) -V8\SymbolValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\SymbolValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\SymbolValue(V8\Value)->IsTypedArray(): bool(false) -V8\SymbolValue(V8\Value)->IsUint8Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\SymbolValue(V8\Value)->IsInt8Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint16Array(): bool(false) -V8\SymbolValue(V8\Value)->IsInt16Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsInt32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsFloat32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsFloat64Array(): bool(false) -V8\SymbolValue(V8\Value)->IsDataView(): bool(false) -V8\SymbolValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\SymbolValue(V8\Value)->IsProxy(): bool(false) +V8\SymbolValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "symbol" + +V8\SymbolValue(V8\Value)->isUndefined(): bool(false) +V8\SymbolValue(V8\Value)->isNull(): bool(false) +V8\SymbolValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\SymbolValue(V8\Value)->isTrue(): bool(false) +V8\SymbolValue(V8\Value)->isFalse(): bool(false) +V8\SymbolValue(V8\Value)->isName(): bool(true) +V8\SymbolValue(V8\Value)->isString(): bool(false) +V8\SymbolValue(V8\Value)->isSymbol(): bool(true) +V8\SymbolValue(V8\Value)->isFunction(): bool(false) +V8\SymbolValue(V8\Value)->isArray(): bool(false) +V8\SymbolValue(V8\Value)->isObject(): bool(false) +V8\SymbolValue(V8\Value)->isBoolean(): bool(false) +V8\SymbolValue(V8\Value)->isNumber(): bool(false) +V8\SymbolValue(V8\Value)->isInt32(): bool(false) +V8\SymbolValue(V8\Value)->isUint32(): bool(false) +V8\SymbolValue(V8\Value)->isDate(): bool(false) +V8\SymbolValue(V8\Value)->isArgumentsObject(): bool(false) +V8\SymbolValue(V8\Value)->isBooleanObject(): bool(false) +V8\SymbolValue(V8\Value)->isNumberObject(): bool(false) +V8\SymbolValue(V8\Value)->isStringObject(): bool(false) +V8\SymbolValue(V8\Value)->isSymbolObject(): bool(false) +V8\SymbolValue(V8\Value)->isNativeError(): bool(false) +V8\SymbolValue(V8\Value)->isRegExp(): bool(false) +V8\SymbolValue(V8\Value)->isAsyncFunction(): bool(false) +V8\SymbolValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\SymbolValue(V8\Value)->isGeneratorObject(): bool(false) +V8\SymbolValue(V8\Value)->isPromise(): bool(false) +V8\SymbolValue(V8\Value)->isMap(): bool(false) +V8\SymbolValue(V8\Value)->isSet(): bool(false) +V8\SymbolValue(V8\Value)->isMapIterator(): bool(false) +V8\SymbolValue(V8\Value)->isSetIterator(): bool(false) +V8\SymbolValue(V8\Value)->isWeakMap(): bool(false) +V8\SymbolValue(V8\Value)->isWeakSet(): bool(false) +V8\SymbolValue(V8\Value)->isArrayBuffer(): bool(false) +V8\SymbolValue(V8\Value)->isArrayBufferView(): bool(false) +V8\SymbolValue(V8\Value)->isTypedArray(): bool(false) +V8\SymbolValue(V8\Value)->isUint8Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\SymbolValue(V8\Value)->isInt8Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint16Array(): bool(false) +V8\SymbolValue(V8\Value)->isInt16Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint32Array(): bool(false) +V8\SymbolValue(V8\Value)->isInt32Array(): bool(false) +V8\SymbolValue(V8\Value)->isFloat32Array(): bool(false) +V8\SymbolValue(V8\Value)->isFloat64Array(): bool(false) +V8\SymbolValue(V8\Value)->isDataView(): bool(false) +V8\SymbolValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\SymbolValue(V8\Value)->isProxy(): bool(false) Null constructor: @@ -265,64 +265,64 @@ SymbolValue extends NameValue: ok Accessors: ---------- -V8\SymbolValue::GetIsolate() matches expected value -V8\SymbolValue->Value(): string(0) "" +V8\SymbolValue::getIsolate() matches expected value +V8\SymbolValue->value(): string(0) "" Name() is undefined: ok GetIdentityHash is integer: ok Checkers: --------- -V8\SymbolValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "symbol" - -V8\SymbolValue(V8\Value)->IsUndefined(): bool(false) -V8\SymbolValue(V8\Value)->IsNull(): bool(false) -V8\SymbolValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\SymbolValue(V8\Value)->IsTrue(): bool(false) -V8\SymbolValue(V8\Value)->IsFalse(): bool(false) -V8\SymbolValue(V8\Value)->IsName(): bool(true) -V8\SymbolValue(V8\Value)->IsString(): bool(false) -V8\SymbolValue(V8\Value)->IsSymbol(): bool(true) -V8\SymbolValue(V8\Value)->IsFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsArray(): bool(false) -V8\SymbolValue(V8\Value)->IsObject(): bool(false) -V8\SymbolValue(V8\Value)->IsBoolean(): bool(false) -V8\SymbolValue(V8\Value)->IsNumber(): bool(false) -V8\SymbolValue(V8\Value)->IsInt32(): bool(false) -V8\SymbolValue(V8\Value)->IsUint32(): bool(false) -V8\SymbolValue(V8\Value)->IsDate(): bool(false) -V8\SymbolValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\SymbolValue(V8\Value)->IsBooleanObject(): bool(false) -V8\SymbolValue(V8\Value)->IsNumberObject(): bool(false) -V8\SymbolValue(V8\Value)->IsStringObject(): bool(false) -V8\SymbolValue(V8\Value)->IsSymbolObject(): bool(false) -V8\SymbolValue(V8\Value)->IsNativeError(): bool(false) -V8\SymbolValue(V8\Value)->IsRegExp(): bool(false) -V8\SymbolValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\SymbolValue(V8\Value)->IsPromise(): bool(false) -V8\SymbolValue(V8\Value)->IsMap(): bool(false) -V8\SymbolValue(V8\Value)->IsSet(): bool(false) -V8\SymbolValue(V8\Value)->IsMapIterator(): bool(false) -V8\SymbolValue(V8\Value)->IsSetIterator(): bool(false) -V8\SymbolValue(V8\Value)->IsWeakMap(): bool(false) -V8\SymbolValue(V8\Value)->IsWeakSet(): bool(false) -V8\SymbolValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\SymbolValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\SymbolValue(V8\Value)->IsTypedArray(): bool(false) -V8\SymbolValue(V8\Value)->IsUint8Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\SymbolValue(V8\Value)->IsInt8Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint16Array(): bool(false) -V8\SymbolValue(V8\Value)->IsInt16Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsInt32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsFloat32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsFloat64Array(): bool(false) -V8\SymbolValue(V8\Value)->IsDataView(): bool(false) -V8\SymbolValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\SymbolValue(V8\Value)->IsProxy(): bool(false) +V8\SymbolValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "symbol" + +V8\SymbolValue(V8\Value)->isUndefined(): bool(false) +V8\SymbolValue(V8\Value)->isNull(): bool(false) +V8\SymbolValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\SymbolValue(V8\Value)->isTrue(): bool(false) +V8\SymbolValue(V8\Value)->isFalse(): bool(false) +V8\SymbolValue(V8\Value)->isName(): bool(true) +V8\SymbolValue(V8\Value)->isString(): bool(false) +V8\SymbolValue(V8\Value)->isSymbol(): bool(true) +V8\SymbolValue(V8\Value)->isFunction(): bool(false) +V8\SymbolValue(V8\Value)->isArray(): bool(false) +V8\SymbolValue(V8\Value)->isObject(): bool(false) +V8\SymbolValue(V8\Value)->isBoolean(): bool(false) +V8\SymbolValue(V8\Value)->isNumber(): bool(false) +V8\SymbolValue(V8\Value)->isInt32(): bool(false) +V8\SymbolValue(V8\Value)->isUint32(): bool(false) +V8\SymbolValue(V8\Value)->isDate(): bool(false) +V8\SymbolValue(V8\Value)->isArgumentsObject(): bool(false) +V8\SymbolValue(V8\Value)->isBooleanObject(): bool(false) +V8\SymbolValue(V8\Value)->isNumberObject(): bool(false) +V8\SymbolValue(V8\Value)->isStringObject(): bool(false) +V8\SymbolValue(V8\Value)->isSymbolObject(): bool(false) +V8\SymbolValue(V8\Value)->isNativeError(): bool(false) +V8\SymbolValue(V8\Value)->isRegExp(): bool(false) +V8\SymbolValue(V8\Value)->isAsyncFunction(): bool(false) +V8\SymbolValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\SymbolValue(V8\Value)->isGeneratorObject(): bool(false) +V8\SymbolValue(V8\Value)->isPromise(): bool(false) +V8\SymbolValue(V8\Value)->isMap(): bool(false) +V8\SymbolValue(V8\Value)->isSet(): bool(false) +V8\SymbolValue(V8\Value)->isMapIterator(): bool(false) +V8\SymbolValue(V8\Value)->isSetIterator(): bool(false) +V8\SymbolValue(V8\Value)->isWeakMap(): bool(false) +V8\SymbolValue(V8\Value)->isWeakSet(): bool(false) +V8\SymbolValue(V8\Value)->isArrayBuffer(): bool(false) +V8\SymbolValue(V8\Value)->isArrayBufferView(): bool(false) +V8\SymbolValue(V8\Value)->isTypedArray(): bool(false) +V8\SymbolValue(V8\Value)->isUint8Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\SymbolValue(V8\Value)->isInt8Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint16Array(): bool(false) +V8\SymbolValue(V8\Value)->isInt16Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint32Array(): bool(false) +V8\SymbolValue(V8\Value)->isInt32Array(): bool(false) +V8\SymbolValue(V8\Value)->isFloat32Array(): bool(false) +V8\SymbolValue(V8\Value)->isFloat64Array(): bool(false) +V8\SymbolValue(V8\Value)->isDataView(): bool(false) +V8\SymbolValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\SymbolValue(V8\Value)->isProxy(): bool(false) Empty StringValue constructor: @@ -341,64 +341,64 @@ SymbolValue extends NameValue: ok Accessors: ---------- -V8\SymbolValue::GetIsolate() matches expected value -V8\SymbolValue->Value(): string(0) "" +V8\SymbolValue::getIsolate() matches expected value +V8\SymbolValue->value(): string(0) "" Name() is String: ok GetIdentityHash is integer: ok Checkers: --------- -V8\SymbolValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "symbol" - -V8\SymbolValue(V8\Value)->IsUndefined(): bool(false) -V8\SymbolValue(V8\Value)->IsNull(): bool(false) -V8\SymbolValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\SymbolValue(V8\Value)->IsTrue(): bool(false) -V8\SymbolValue(V8\Value)->IsFalse(): bool(false) -V8\SymbolValue(V8\Value)->IsName(): bool(true) -V8\SymbolValue(V8\Value)->IsString(): bool(false) -V8\SymbolValue(V8\Value)->IsSymbol(): bool(true) -V8\SymbolValue(V8\Value)->IsFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsArray(): bool(false) -V8\SymbolValue(V8\Value)->IsObject(): bool(false) -V8\SymbolValue(V8\Value)->IsBoolean(): bool(false) -V8\SymbolValue(V8\Value)->IsNumber(): bool(false) -V8\SymbolValue(V8\Value)->IsInt32(): bool(false) -V8\SymbolValue(V8\Value)->IsUint32(): bool(false) -V8\SymbolValue(V8\Value)->IsDate(): bool(false) -V8\SymbolValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\SymbolValue(V8\Value)->IsBooleanObject(): bool(false) -V8\SymbolValue(V8\Value)->IsNumberObject(): bool(false) -V8\SymbolValue(V8\Value)->IsStringObject(): bool(false) -V8\SymbolValue(V8\Value)->IsSymbolObject(): bool(false) -V8\SymbolValue(V8\Value)->IsNativeError(): bool(false) -V8\SymbolValue(V8\Value)->IsRegExp(): bool(false) -V8\SymbolValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\SymbolValue(V8\Value)->IsPromise(): bool(false) -V8\SymbolValue(V8\Value)->IsMap(): bool(false) -V8\SymbolValue(V8\Value)->IsSet(): bool(false) -V8\SymbolValue(V8\Value)->IsMapIterator(): bool(false) -V8\SymbolValue(V8\Value)->IsSetIterator(): bool(false) -V8\SymbolValue(V8\Value)->IsWeakMap(): bool(false) -V8\SymbolValue(V8\Value)->IsWeakSet(): bool(false) -V8\SymbolValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\SymbolValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\SymbolValue(V8\Value)->IsTypedArray(): bool(false) -V8\SymbolValue(V8\Value)->IsUint8Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\SymbolValue(V8\Value)->IsInt8Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint16Array(): bool(false) -V8\SymbolValue(V8\Value)->IsInt16Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsInt32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsFloat32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsFloat64Array(): bool(false) -V8\SymbolValue(V8\Value)->IsDataView(): bool(false) -V8\SymbolValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\SymbolValue(V8\Value)->IsProxy(): bool(false) +V8\SymbolValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "symbol" + +V8\SymbolValue(V8\Value)->isUndefined(): bool(false) +V8\SymbolValue(V8\Value)->isNull(): bool(false) +V8\SymbolValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\SymbolValue(V8\Value)->isTrue(): bool(false) +V8\SymbolValue(V8\Value)->isFalse(): bool(false) +V8\SymbolValue(V8\Value)->isName(): bool(true) +V8\SymbolValue(V8\Value)->isString(): bool(false) +V8\SymbolValue(V8\Value)->isSymbol(): bool(true) +V8\SymbolValue(V8\Value)->isFunction(): bool(false) +V8\SymbolValue(V8\Value)->isArray(): bool(false) +V8\SymbolValue(V8\Value)->isObject(): bool(false) +V8\SymbolValue(V8\Value)->isBoolean(): bool(false) +V8\SymbolValue(V8\Value)->isNumber(): bool(false) +V8\SymbolValue(V8\Value)->isInt32(): bool(false) +V8\SymbolValue(V8\Value)->isUint32(): bool(false) +V8\SymbolValue(V8\Value)->isDate(): bool(false) +V8\SymbolValue(V8\Value)->isArgumentsObject(): bool(false) +V8\SymbolValue(V8\Value)->isBooleanObject(): bool(false) +V8\SymbolValue(V8\Value)->isNumberObject(): bool(false) +V8\SymbolValue(V8\Value)->isStringObject(): bool(false) +V8\SymbolValue(V8\Value)->isSymbolObject(): bool(false) +V8\SymbolValue(V8\Value)->isNativeError(): bool(false) +V8\SymbolValue(V8\Value)->isRegExp(): bool(false) +V8\SymbolValue(V8\Value)->isAsyncFunction(): bool(false) +V8\SymbolValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\SymbolValue(V8\Value)->isGeneratorObject(): bool(false) +V8\SymbolValue(V8\Value)->isPromise(): bool(false) +V8\SymbolValue(V8\Value)->isMap(): bool(false) +V8\SymbolValue(V8\Value)->isSet(): bool(false) +V8\SymbolValue(V8\Value)->isMapIterator(): bool(false) +V8\SymbolValue(V8\Value)->isSetIterator(): bool(false) +V8\SymbolValue(V8\Value)->isWeakMap(): bool(false) +V8\SymbolValue(V8\Value)->isWeakSet(): bool(false) +V8\SymbolValue(V8\Value)->isArrayBuffer(): bool(false) +V8\SymbolValue(V8\Value)->isArrayBufferView(): bool(false) +V8\SymbolValue(V8\Value)->isTypedArray(): bool(false) +V8\SymbolValue(V8\Value)->isUint8Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\SymbolValue(V8\Value)->isInt8Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint16Array(): bool(false) +V8\SymbolValue(V8\Value)->isInt16Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint32Array(): bool(false) +V8\SymbolValue(V8\Value)->isInt32Array(): bool(false) +V8\SymbolValue(V8\Value)->isFloat32Array(): bool(false) +V8\SymbolValue(V8\Value)->isFloat64Array(): bool(false) +V8\SymbolValue(V8\Value)->isDataView(): bool(false) +V8\SymbolValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\SymbolValue(V8\Value)->isProxy(): bool(false) Symbol name: @@ -421,64 +421,64 @@ SymbolValue extends NameValue: ok Accessors: ---------- -V8\SymbolValue::GetIsolate() matches expected value -V8\SymbolValue->Value(): string(4) "test" +V8\SymbolValue::getIsolate() matches expected value +V8\SymbolValue->value(): string(4) "test" Name() is String: ok GetIdentityHash is integer: ok Checkers: --------- -V8\SymbolValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "symbol" - -V8\SymbolValue(V8\Value)->IsUndefined(): bool(false) -V8\SymbolValue(V8\Value)->IsNull(): bool(false) -V8\SymbolValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\SymbolValue(V8\Value)->IsTrue(): bool(false) -V8\SymbolValue(V8\Value)->IsFalse(): bool(false) -V8\SymbolValue(V8\Value)->IsName(): bool(true) -V8\SymbolValue(V8\Value)->IsString(): bool(false) -V8\SymbolValue(V8\Value)->IsSymbol(): bool(true) -V8\SymbolValue(V8\Value)->IsFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsArray(): bool(false) -V8\SymbolValue(V8\Value)->IsObject(): bool(false) -V8\SymbolValue(V8\Value)->IsBoolean(): bool(false) -V8\SymbolValue(V8\Value)->IsNumber(): bool(false) -V8\SymbolValue(V8\Value)->IsInt32(): bool(false) -V8\SymbolValue(V8\Value)->IsUint32(): bool(false) -V8\SymbolValue(V8\Value)->IsDate(): bool(false) -V8\SymbolValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\SymbolValue(V8\Value)->IsBooleanObject(): bool(false) -V8\SymbolValue(V8\Value)->IsNumberObject(): bool(false) -V8\SymbolValue(V8\Value)->IsStringObject(): bool(false) -V8\SymbolValue(V8\Value)->IsSymbolObject(): bool(false) -V8\SymbolValue(V8\Value)->IsNativeError(): bool(false) -V8\SymbolValue(V8\Value)->IsRegExp(): bool(false) -V8\SymbolValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\SymbolValue(V8\Value)->IsPromise(): bool(false) -V8\SymbolValue(V8\Value)->IsMap(): bool(false) -V8\SymbolValue(V8\Value)->IsSet(): bool(false) -V8\SymbolValue(V8\Value)->IsMapIterator(): bool(false) -V8\SymbolValue(V8\Value)->IsSetIterator(): bool(false) -V8\SymbolValue(V8\Value)->IsWeakMap(): bool(false) -V8\SymbolValue(V8\Value)->IsWeakSet(): bool(false) -V8\SymbolValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\SymbolValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\SymbolValue(V8\Value)->IsTypedArray(): bool(false) -V8\SymbolValue(V8\Value)->IsUint8Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\SymbolValue(V8\Value)->IsInt8Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint16Array(): bool(false) -V8\SymbolValue(V8\Value)->IsInt16Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsInt32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsFloat32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsFloat64Array(): bool(false) -V8\SymbolValue(V8\Value)->IsDataView(): bool(false) -V8\SymbolValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\SymbolValue(V8\Value)->IsProxy(): bool(false) +V8\SymbolValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "symbol" + +V8\SymbolValue(V8\Value)->isUndefined(): bool(false) +V8\SymbolValue(V8\Value)->isNull(): bool(false) +V8\SymbolValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\SymbolValue(V8\Value)->isTrue(): bool(false) +V8\SymbolValue(V8\Value)->isFalse(): bool(false) +V8\SymbolValue(V8\Value)->isName(): bool(true) +V8\SymbolValue(V8\Value)->isString(): bool(false) +V8\SymbolValue(V8\Value)->isSymbol(): bool(true) +V8\SymbolValue(V8\Value)->isFunction(): bool(false) +V8\SymbolValue(V8\Value)->isArray(): bool(false) +V8\SymbolValue(V8\Value)->isObject(): bool(false) +V8\SymbolValue(V8\Value)->isBoolean(): bool(false) +V8\SymbolValue(V8\Value)->isNumber(): bool(false) +V8\SymbolValue(V8\Value)->isInt32(): bool(false) +V8\SymbolValue(V8\Value)->isUint32(): bool(false) +V8\SymbolValue(V8\Value)->isDate(): bool(false) +V8\SymbolValue(V8\Value)->isArgumentsObject(): bool(false) +V8\SymbolValue(V8\Value)->isBooleanObject(): bool(false) +V8\SymbolValue(V8\Value)->isNumberObject(): bool(false) +V8\SymbolValue(V8\Value)->isStringObject(): bool(false) +V8\SymbolValue(V8\Value)->isSymbolObject(): bool(false) +V8\SymbolValue(V8\Value)->isNativeError(): bool(false) +V8\SymbolValue(V8\Value)->isRegExp(): bool(false) +V8\SymbolValue(V8\Value)->isAsyncFunction(): bool(false) +V8\SymbolValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\SymbolValue(V8\Value)->isGeneratorObject(): bool(false) +V8\SymbolValue(V8\Value)->isPromise(): bool(false) +V8\SymbolValue(V8\Value)->isMap(): bool(false) +V8\SymbolValue(V8\Value)->isSet(): bool(false) +V8\SymbolValue(V8\Value)->isMapIterator(): bool(false) +V8\SymbolValue(V8\Value)->isSetIterator(): bool(false) +V8\SymbolValue(V8\Value)->isWeakMap(): bool(false) +V8\SymbolValue(V8\Value)->isWeakSet(): bool(false) +V8\SymbolValue(V8\Value)->isArrayBuffer(): bool(false) +V8\SymbolValue(V8\Value)->isArrayBufferView(): bool(false) +V8\SymbolValue(V8\Value)->isTypedArray(): bool(false) +V8\SymbolValue(V8\Value)->isUint8Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\SymbolValue(V8\Value)->isInt8Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint16Array(): bool(false) +V8\SymbolValue(V8\Value)->isInt16Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint32Array(): bool(false) +V8\SymbolValue(V8\Value)->isInt32Array(): bool(false) +V8\SymbolValue(V8\Value)->isFloat32Array(): bool(false) +V8\SymbolValue(V8\Value)->isFloat64Array(): bool(false) +V8\SymbolValue(V8\Value)->isDataView(): bool(false) +V8\SymbolValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\SymbolValue(V8\Value)->isProxy(): bool(false) Symbol name: @@ -487,111 +487,111 @@ string(4) "test" Checkers on name: ----------------- -V8\StringValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "string" - -V8\StringValue->IsOneByte(): bool(true) -V8\StringValue(V8\Value)->IsUndefined(): bool(false) -V8\StringValue(V8\Value)->IsNull(): bool(false) -V8\StringValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\StringValue(V8\Value)->IsTrue(): bool(false) -V8\StringValue(V8\Value)->IsFalse(): bool(false) -V8\StringValue(V8\Value)->IsName(): bool(true) -V8\StringValue(V8\Value)->IsString(): bool(true) -V8\StringValue(V8\Value)->IsSymbol(): bool(false) -V8\StringValue(V8\Value)->IsFunction(): bool(false) -V8\StringValue(V8\Value)->IsArray(): bool(false) -V8\StringValue(V8\Value)->IsObject(): bool(false) -V8\StringValue(V8\Value)->IsBoolean(): bool(false) -V8\StringValue(V8\Value)->IsNumber(): bool(false) -V8\StringValue(V8\Value)->IsInt32(): bool(false) -V8\StringValue(V8\Value)->IsUint32(): bool(false) -V8\StringValue(V8\Value)->IsDate(): bool(false) -V8\StringValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\StringValue(V8\Value)->IsBooleanObject(): bool(false) -V8\StringValue(V8\Value)->IsNumberObject(): bool(false) -V8\StringValue(V8\Value)->IsStringObject(): bool(false) -V8\StringValue(V8\Value)->IsSymbolObject(): bool(false) -V8\StringValue(V8\Value)->IsNativeError(): bool(false) -V8\StringValue(V8\Value)->IsRegExp(): bool(false) -V8\StringValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\StringValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\StringValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\StringValue(V8\Value)->IsPromise(): bool(false) -V8\StringValue(V8\Value)->IsMap(): bool(false) -V8\StringValue(V8\Value)->IsSet(): bool(false) -V8\StringValue(V8\Value)->IsMapIterator(): bool(false) -V8\StringValue(V8\Value)->IsSetIterator(): bool(false) -V8\StringValue(V8\Value)->IsWeakMap(): bool(false) -V8\StringValue(V8\Value)->IsWeakSet(): bool(false) -V8\StringValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\StringValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\StringValue(V8\Value)->IsTypedArray(): bool(false) -V8\StringValue(V8\Value)->IsUint8Array(): bool(false) -V8\StringValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\StringValue(V8\Value)->IsInt8Array(): bool(false) -V8\StringValue(V8\Value)->IsUint16Array(): bool(false) -V8\StringValue(V8\Value)->IsInt16Array(): bool(false) -V8\StringValue(V8\Value)->IsUint32Array(): bool(false) -V8\StringValue(V8\Value)->IsInt32Array(): bool(false) -V8\StringValue(V8\Value)->IsFloat32Array(): bool(false) -V8\StringValue(V8\Value)->IsFloat64Array(): bool(false) -V8\StringValue(V8\Value)->IsDataView(): bool(false) -V8\StringValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\StringValue(V8\Value)->IsProxy(): bool(false) +V8\StringValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "string" + +V8\StringValue->isOneByte(): bool(true) +V8\StringValue(V8\Value)->isUndefined(): bool(false) +V8\StringValue(V8\Value)->isNull(): bool(false) +V8\StringValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\StringValue(V8\Value)->isTrue(): bool(false) +V8\StringValue(V8\Value)->isFalse(): bool(false) +V8\StringValue(V8\Value)->isName(): bool(true) +V8\StringValue(V8\Value)->isString(): bool(true) +V8\StringValue(V8\Value)->isSymbol(): bool(false) +V8\StringValue(V8\Value)->isFunction(): bool(false) +V8\StringValue(V8\Value)->isArray(): bool(false) +V8\StringValue(V8\Value)->isObject(): bool(false) +V8\StringValue(V8\Value)->isBoolean(): bool(false) +V8\StringValue(V8\Value)->isNumber(): bool(false) +V8\StringValue(V8\Value)->isInt32(): bool(false) +V8\StringValue(V8\Value)->isUint32(): bool(false) +V8\StringValue(V8\Value)->isDate(): bool(false) +V8\StringValue(V8\Value)->isArgumentsObject(): bool(false) +V8\StringValue(V8\Value)->isBooleanObject(): bool(false) +V8\StringValue(V8\Value)->isNumberObject(): bool(false) +V8\StringValue(V8\Value)->isStringObject(): bool(false) +V8\StringValue(V8\Value)->isSymbolObject(): bool(false) +V8\StringValue(V8\Value)->isNativeError(): bool(false) +V8\StringValue(V8\Value)->isRegExp(): bool(false) +V8\StringValue(V8\Value)->isAsyncFunction(): bool(false) +V8\StringValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\StringValue(V8\Value)->isGeneratorObject(): bool(false) +V8\StringValue(V8\Value)->isPromise(): bool(false) +V8\StringValue(V8\Value)->isMap(): bool(false) +V8\StringValue(V8\Value)->isSet(): bool(false) +V8\StringValue(V8\Value)->isMapIterator(): bool(false) +V8\StringValue(V8\Value)->isSetIterator(): bool(false) +V8\StringValue(V8\Value)->isWeakMap(): bool(false) +V8\StringValue(V8\Value)->isWeakSet(): bool(false) +V8\StringValue(V8\Value)->isArrayBuffer(): bool(false) +V8\StringValue(V8\Value)->isArrayBufferView(): bool(false) +V8\StringValue(V8\Value)->isTypedArray(): bool(false) +V8\StringValue(V8\Value)->isUint8Array(): bool(false) +V8\StringValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\StringValue(V8\Value)->isInt8Array(): bool(false) +V8\StringValue(V8\Value)->isUint16Array(): bool(false) +V8\StringValue(V8\Value)->isInt16Array(): bool(false) +V8\StringValue(V8\Value)->isUint32Array(): bool(false) +V8\StringValue(V8\Value)->isInt32Array(): bool(false) +V8\StringValue(V8\Value)->isFloat32Array(): bool(false) +V8\StringValue(V8\Value)->isFloat64Array(): bool(false) +V8\StringValue(V8\Value)->isDataView(): bool(false) +V8\StringValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\StringValue(V8\Value)->isProxy(): bool(false) Checkers on Symbol value from script: ------------------------------------- -V8\SymbolValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "symbol" - -V8\SymbolValue(V8\Value)->IsUndefined(): bool(false) -V8\SymbolValue(V8\Value)->IsNull(): bool(false) -V8\SymbolValue(V8\Value)->IsNullOrUndefined(): bool(false) -V8\SymbolValue(V8\Value)->IsTrue(): bool(false) -V8\SymbolValue(V8\Value)->IsFalse(): bool(false) -V8\SymbolValue(V8\Value)->IsName(): bool(true) -V8\SymbolValue(V8\Value)->IsString(): bool(false) -V8\SymbolValue(V8\Value)->IsSymbol(): bool(true) -V8\SymbolValue(V8\Value)->IsFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsArray(): bool(false) -V8\SymbolValue(V8\Value)->IsObject(): bool(false) -V8\SymbolValue(V8\Value)->IsBoolean(): bool(false) -V8\SymbolValue(V8\Value)->IsNumber(): bool(false) -V8\SymbolValue(V8\Value)->IsInt32(): bool(false) -V8\SymbolValue(V8\Value)->IsUint32(): bool(false) -V8\SymbolValue(V8\Value)->IsDate(): bool(false) -V8\SymbolValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\SymbolValue(V8\Value)->IsBooleanObject(): bool(false) -V8\SymbolValue(V8\Value)->IsNumberObject(): bool(false) -V8\SymbolValue(V8\Value)->IsStringObject(): bool(false) -V8\SymbolValue(V8\Value)->IsSymbolObject(): bool(false) -V8\SymbolValue(V8\Value)->IsNativeError(): bool(false) -V8\SymbolValue(V8\Value)->IsRegExp(): bool(false) -V8\SymbolValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\SymbolValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\SymbolValue(V8\Value)->IsPromise(): bool(false) -V8\SymbolValue(V8\Value)->IsMap(): bool(false) -V8\SymbolValue(V8\Value)->IsSet(): bool(false) -V8\SymbolValue(V8\Value)->IsMapIterator(): bool(false) -V8\SymbolValue(V8\Value)->IsSetIterator(): bool(false) -V8\SymbolValue(V8\Value)->IsWeakMap(): bool(false) -V8\SymbolValue(V8\Value)->IsWeakSet(): bool(false) -V8\SymbolValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\SymbolValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\SymbolValue(V8\Value)->IsTypedArray(): bool(false) -V8\SymbolValue(V8\Value)->IsUint8Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\SymbolValue(V8\Value)->IsInt8Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint16Array(): bool(false) -V8\SymbolValue(V8\Value)->IsInt16Array(): bool(false) -V8\SymbolValue(V8\Value)->IsUint32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsInt32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsFloat32Array(): bool(false) -V8\SymbolValue(V8\Value)->IsFloat64Array(): bool(false) -V8\SymbolValue(V8\Value)->IsDataView(): bool(false) -V8\SymbolValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\SymbolValue(V8\Value)->IsProxy(): bool(false) +V8\SymbolValue(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "symbol" + +V8\SymbolValue(V8\Value)->isUndefined(): bool(false) +V8\SymbolValue(V8\Value)->isNull(): bool(false) +V8\SymbolValue(V8\Value)->isNullOrUndefined(): bool(false) +V8\SymbolValue(V8\Value)->isTrue(): bool(false) +V8\SymbolValue(V8\Value)->isFalse(): bool(false) +V8\SymbolValue(V8\Value)->isName(): bool(true) +V8\SymbolValue(V8\Value)->isString(): bool(false) +V8\SymbolValue(V8\Value)->isSymbol(): bool(true) +V8\SymbolValue(V8\Value)->isFunction(): bool(false) +V8\SymbolValue(V8\Value)->isArray(): bool(false) +V8\SymbolValue(V8\Value)->isObject(): bool(false) +V8\SymbolValue(V8\Value)->isBoolean(): bool(false) +V8\SymbolValue(V8\Value)->isNumber(): bool(false) +V8\SymbolValue(V8\Value)->isInt32(): bool(false) +V8\SymbolValue(V8\Value)->isUint32(): bool(false) +V8\SymbolValue(V8\Value)->isDate(): bool(false) +V8\SymbolValue(V8\Value)->isArgumentsObject(): bool(false) +V8\SymbolValue(V8\Value)->isBooleanObject(): bool(false) +V8\SymbolValue(V8\Value)->isNumberObject(): bool(false) +V8\SymbolValue(V8\Value)->isStringObject(): bool(false) +V8\SymbolValue(V8\Value)->isSymbolObject(): bool(false) +V8\SymbolValue(V8\Value)->isNativeError(): bool(false) +V8\SymbolValue(V8\Value)->isRegExp(): bool(false) +V8\SymbolValue(V8\Value)->isAsyncFunction(): bool(false) +V8\SymbolValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\SymbolValue(V8\Value)->isGeneratorObject(): bool(false) +V8\SymbolValue(V8\Value)->isPromise(): bool(false) +V8\SymbolValue(V8\Value)->isMap(): bool(false) +V8\SymbolValue(V8\Value)->isSet(): bool(false) +V8\SymbolValue(V8\Value)->isMapIterator(): bool(false) +V8\SymbolValue(V8\Value)->isSetIterator(): bool(false) +V8\SymbolValue(V8\Value)->isWeakMap(): bool(false) +V8\SymbolValue(V8\Value)->isWeakSet(): bool(false) +V8\SymbolValue(V8\Value)->isArrayBuffer(): bool(false) +V8\SymbolValue(V8\Value)->isArrayBufferView(): bool(false) +V8\SymbolValue(V8\Value)->isTypedArray(): bool(false) +V8\SymbolValue(V8\Value)->isUint8Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\SymbolValue(V8\Value)->isInt8Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint16Array(): bool(false) +V8\SymbolValue(V8\Value)->isInt16Array(): bool(false) +V8\SymbolValue(V8\Value)->isUint32Array(): bool(false) +V8\SymbolValue(V8\Value)->isInt32Array(): bool(false) +V8\SymbolValue(V8\Value)->isFloat32Array(): bool(false) +V8\SymbolValue(V8\Value)->isFloat64Array(): bool(false) +V8\SymbolValue(V8\Value)->isDataView(): bool(false) +V8\SymbolValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\SymbolValue(V8\Value)->isProxy(): bool(false) Symbol For(string) returned: ok diff --git a/tests/V8TryCatch.phpt b/tests/V8TryCatch.phpt index 87f4a01..a65ba21 100644 --- a/tests/V8TryCatch.phpt +++ b/tests/V8TryCatch.phpt @@ -22,14 +22,14 @@ $helper->dump($obj); $helper->space(); $helper->header('Test getters (default)'); -$helper->method_matches($obj, 'GetIsolate', $isolate); -$helper->method_matches($obj, 'GetContext', $context); -$helper->method_matches($obj, 'Exception', null); -$helper->method_matches($obj, 'Message', null); -$helper->method_matches($obj, 'StackTrace', null); - -$helper->method_matches($obj, 'CanContinue', false); -$helper->method_matches($obj, 'HasTerminated', false); +$helper->method_matches($obj, 'getIsolate', $isolate); +$helper->method_matches($obj, 'getContext', $context); +$helper->method_matches($obj, 'exception', null); +$helper->method_matches($obj, 'message', null); +$helper->method_matches($obj, 'stackTrace', null); + +$helper->method_matches($obj, 'canContinue', false); +$helper->method_matches($obj, 'hasTerminated', false); $helper->space(); @@ -45,14 +45,14 @@ $helper->dump($obj); $helper->space(); $helper->header('Test getters'); -$helper->method_matches($obj, 'GetIsolate', $isolate); -$helper->method_matches($obj, 'GetContext', $context); -$helper->method_matches($obj, 'Exception', $exception); -$helper->method_matches($obj, 'Message', $message); -$helper->method_matches($obj, 'StackTrace', $trace); +$helper->method_matches($obj, 'getIsolate', $isolate); +$helper->method_matches($obj, 'getContext', $context); +$helper->method_matches($obj, 'exception', $exception); +$helper->method_matches($obj, 'message', $message); +$helper->method_matches($obj, 'stackTrace', $trace); -$helper->method_matches($obj, 'CanContinue', true); -$helper->method_matches($obj, 'HasTerminated', true); +$helper->method_matches($obj, 'canContinue', true); +$helper->method_matches($obj, 'hasTerminated', true); $helper->method_matches($obj, 'getExternalException', $php_exception); $helper->space(); @@ -98,13 +98,13 @@ object(V8\TryCatch)#4 (8) { Test getters (default): ----------------------- -V8\TryCatch::GetIsolate() matches expected value -V8\TryCatch::GetContext() matches expected value -V8\TryCatch::Exception() matches expected value -V8\TryCatch::Message() matches expected value -V8\TryCatch::StackTrace() matches expected value -V8\TryCatch::CanContinue() matches expected value -V8\TryCatch::HasTerminated() matches expected value +V8\TryCatch::getIsolate() matches expected value +V8\TryCatch::getContext() matches expected value +V8\TryCatch::exception() matches expected value +V8\TryCatch::message() matches expected value +V8\TryCatch::stackTrace() matches expected value +V8\TryCatch::canContinue() matches expected value +V8\TryCatch::hasTerminated() matches expected value Object representation: @@ -217,13 +217,13 @@ object(V8\TryCatch)#11 (8) { Test getters: ------------- -V8\TryCatch::GetIsolate() matches expected value -V8\TryCatch::GetContext() matches expected value -V8\TryCatch::Exception() matches expected value -V8\TryCatch::Message() matches expected value -V8\TryCatch::StackTrace() matches expected value -V8\TryCatch::CanContinue() matches expected value -V8\TryCatch::HasTerminated() matches expected value +V8\TryCatch::getIsolate() matches expected value +V8\TryCatch::getContext() matches expected value +V8\TryCatch::exception() matches expected value +V8\TryCatch::message() matches expected value +V8\TryCatch::stackTrace() matches expected value +V8\TryCatch::canContinue() matches expected value +V8\TryCatch::hasTerminated() matches expected value V8\TryCatch::getExternalException() matches expected value diff --git a/tests/V8TryCatch_from_script.phpt b/tests/V8TryCatch_from_script.phpt index 59fdc81..ee55512 100644 --- a/tests/V8TryCatch_from_script.phpt +++ b/tests/V8TryCatch_from_script.phpt @@ -18,7 +18,7 @@ $isolate = new \v8Tests\TrackingDtors\Isolate(); $nested_try_catch_func_tpl = new \v8Tests\TrackingDtors\FunctionTemplate($isolate, function (\V8\FunctionCallbackInfo $args) use ($helper) { - $isolate = $args->GetIsolate(); + $isolate = $args->getIsolate(); $nested_context = new \V8\Context($isolate); $source = /** @lang JavaScript */ @@ -29,26 +29,26 @@ $nested_try_catch_func_tpl = new \v8Tests\TrackingDtors\FunctionTemplate($isolat $script = new v8Tests\TrackingDtors\Script($nested_context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); try{ - $script->Run($nested_context); + $script->run($nested_context); } catch (V8\Exceptions\TryCatchException $e) { $helper->exception_export($e); $helper->line(); - $helper->assert('TryCatchException holds the same isolate it was thrown', $e->GetIsolate(), $isolate); - $helper->assert('TryCatchException holds the same context it was thrown', $e->GetContext(), $nested_context); + $helper->assert('TryCatchException holds the same isolate it was thrown', $e->getIsolate(), $isolate); + $helper->assert('TryCatchException holds the same context it was thrown', $e->getContext(), $nested_context); - $try_catch = $e->GetTryCatch(); + $try_catch = $e->getTryCatch(); - $helper->assert('TryCatch holds the same isolate it was thrown', $try_catch->GetIsolate(), $isolate); - $helper->assert('TryCatch holds the same context it was thrown', $try_catch->GetContext(), $nested_context); + $helper->assert('TryCatch holds the same isolate it was thrown', $try_catch->getIsolate(), $isolate); + $helper->assert('TryCatch holds the same context it was thrown', $try_catch->getContext(), $nested_context); - $helper->dump($e->GetTryCatch()->Message()->Get()); + $helper->dump($e->getTryCatch()->message()->get()); $helper->line(); } }); $global_object_tpl = new \v8Tests\TrackingDtors\ObjectTemplate($isolate); -$global_object_tpl->Set(new \V8\StringValue($isolate, 'nested_throw'), $nested_try_catch_func_tpl); +$global_object_tpl->set(new \V8\StringValue($isolate, 'nested_throw'), $nested_try_catch_func_tpl); $context = new v8Tests\TrackingDtors\Context($isolate, $global_object_tpl); $source = /** @lang JavaScript */ @@ -58,34 +58,34 @@ $file_name = 'test.js'; $script = new v8Tests\TrackingDtors\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); try { - $res = $script->Run($context); + $res = $script->run($context); } catch (V8\Exceptions\TryCatchException $e) { $helper->exception_export($e); $helper->line(); - $helper->assert('TryCatchException holds the same isolate it was thrown', $e->GetIsolate(), $script->GetIsolate()); - $helper->assert('TryCatchException holds the same context it was thrown', $e->GetContext(), $script->GetContext()); + $helper->assert('TryCatchException holds the same isolate it was thrown', $e->getIsolate(), $script->getIsolate()); + $helper->assert('TryCatchException holds the same context it was thrown', $e->getContext(), $script->getContext()); - $try_catch = $e->GetTryCatch(); - $helper->assert('TryCatch holds the same isolate it was thrown', $try_catch->GetIsolate(), $script->GetIsolate()); - $helper->assert('TryCatch holds the same context it was thrown', $try_catch->GetContext(), $script->GetContext()); + $try_catch = $e->getTryCatch(); + $helper->assert('TryCatch holds the same isolate it was thrown', $try_catch->getIsolate(), $script->getIsolate()); + $helper->assert('TryCatch holds the same context it was thrown', $try_catch->getContext(), $script->getContext()); - $helper->dump($e->GetTryCatch()->Message()->Get()); + $helper->dump($e->getTryCatch()->message()->get()); $helper->line(); - $helper->assert('TryCatchException message has not stack trace', $e->GetTryCatch()->Message()->GetStackTrace() === null); + $helper->assert('TryCatchException message has not stack trace', $e->getTryCatch()->message()->getStackTrace() === null); $helper->line(); } -$isolate->SetCaptureStackTraceForUncaughtExceptions(true); +$isolate->setCaptureStackTraceForUncaughtExceptions(true); try { - $res = $script->Run($context); + $res = $script->run($context); } catch (V8\Exceptions\TryCatchException $e) { $helper->exception_export($e); $helper->line(); - $helper->assert('TryCatchException message has stack trace', $e->GetTryCatch()->Message()->GetStackTrace() instanceof \V8\StackTrace); + $helper->assert('TryCatchException message has stack trace', $e->getTryCatch()->message()->getStackTrace() instanceof \V8\StackTrace); $helper->line(); } @@ -101,19 +101,19 @@ $script = new v8Tests\TrackingDtors\Script($context, new \V8\StringValue($isolat try { - $res = $script->Run($context); + $res = $script->run($context); } catch (V8\Exceptions\TryCatchException $e) { $helper->exception_export($e); $helper->line(); - $helper->assert('TryCatchException holds the same isolate it was thrown', $e->GetIsolate(), $script->GetIsolate()); - $helper->assert('TryCatchException holds the same context it was thrown', $e->GetContext(), $script->GetContext()); + $helper->assert('TryCatchException holds the same isolate it was thrown', $e->getIsolate(), $script->getIsolate()); + $helper->assert('TryCatchException holds the same context it was thrown', $e->getContext(), $script->getContext()); - $try_catch = $e->GetTryCatch(); - $helper->assert('TryCatch holds the same isolate it was thrown', $try_catch->GetIsolate(), $script->GetIsolate()); - $helper->assert('TryCatch holds the same context it was thrown', $try_catch->GetContext(), $script->GetContext()); + $try_catch = $e->getTryCatch(); + $helper->assert('TryCatch holds the same isolate it was thrown', $try_catch->getIsolate(), $script->getIsolate()); + $helper->assert('TryCatch holds the same context it was thrown', $try_catch->getContext(), $script->getContext()); - $helper->dump($e->GetTryCatch()->Message()->Get()); + $helper->dump($e->getTryCatch()->message()->get()); $helper->line(); } @@ -124,10 +124,10 @@ try { $helper->exception_export($e); $helper->line(); - $helper->assert('TryCatchException holds the same context it was thrown', $e->GetContext(), $context); - $helper->assert('TryCatchException holds the same isolate it was thrown', $e->GetIsolate(), $isolate); + $helper->assert('TryCatchException holds the same context it was thrown', $e->getContext(), $context); + $helper->assert('TryCatchException holds the same isolate it was thrown', $e->getIsolate(), $isolate); - $helper->dump($e->GetTryCatch()->Message()->Get()); + $helper->dump($e->getTryCatch()->message()->get()); $helper->line(); } diff --git a/tests/V8Uint32Value.phpt b/tests/V8Uint32Value.phpt index e54a934..de2482b 100644 --- a/tests/V8Uint32Value.phpt +++ b/tests/V8Uint32Value.phpt @@ -25,8 +25,8 @@ $helper->assert('Uint32Value extends IntegerValue', $value instanceof \V8\Intege $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_export($value, 'Value'); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_export($value, 'value'); $helper->space(); @@ -36,18 +36,18 @@ $global_template = new \V8\ObjectTemplate($isolate); $context = new \V8\Context($isolate, $global_template); -$string = $value->ToString($context); +$string = $value->toString($context); -$helper->header(get_class($value) .'::ToString() converting'); +$helper->header(get_class($value) .'::toString() converting'); $helper->dump($string); -$helper->dump($string->Value()); +$helper->dump($string->value()); $helper->space(); $helper->header('Primitive converters'); -$helper->method_export($value, 'BooleanValue', [$context]); -$helper->method_export($value, 'NumberValue', [$context]); +$helper->method_export($value, 'booleanValue', [$context]); +$helper->method_export($value, 'numberValue', [$context]); $helper->space(); @@ -58,7 +58,7 @@ foreach ([-1, PHP_INT_MAX, -PHP_INT_MAX, NAN, INF, -INF] as $val) { $helper->value_export($val); try { $value = new V8\Uint32Value($isolate, $val); - $helper->method_export($value, 'Value'); + $helper->method_export($value, 'value'); } catch (Throwable $e) { $helper->exception_export($e); } @@ -81,65 +81,65 @@ Uint32Value extends IntegerValue: ok Accessors: ---------- -V8\Uint32Value::GetIsolate() matches expected value -V8\Uint32Value->Value(): int(2147483648) +V8\Uint32Value::getIsolate() matches expected value +V8\Uint32Value->value(): int(2147483648) Checkers for negative: ---------------------- -V8\Uint32Value(V8\Value)->TypeOf(): V8\StringValue->Value(): string(6) "number" - -V8\Uint32Value(V8\Value)->IsUndefined(): bool(false) -V8\Uint32Value(V8\Value)->IsNull(): bool(false) -V8\Uint32Value(V8\Value)->IsNullOrUndefined(): bool(false) -V8\Uint32Value(V8\Value)->IsTrue(): bool(false) -V8\Uint32Value(V8\Value)->IsFalse(): bool(false) -V8\Uint32Value(V8\Value)->IsName(): bool(false) -V8\Uint32Value(V8\Value)->IsString(): bool(false) -V8\Uint32Value(V8\Value)->IsSymbol(): bool(false) -V8\Uint32Value(V8\Value)->IsFunction(): bool(false) -V8\Uint32Value(V8\Value)->IsArray(): bool(false) -V8\Uint32Value(V8\Value)->IsObject(): bool(false) -V8\Uint32Value(V8\Value)->IsBoolean(): bool(false) -V8\Uint32Value(V8\Value)->IsNumber(): bool(true) -V8\Uint32Value(V8\Value)->IsInt32(): bool(false) -V8\Uint32Value(V8\Value)->IsUint32(): bool(true) -V8\Uint32Value(V8\Value)->IsDate(): bool(false) -V8\Uint32Value(V8\Value)->IsArgumentsObject(): bool(false) -V8\Uint32Value(V8\Value)->IsBooleanObject(): bool(false) -V8\Uint32Value(V8\Value)->IsNumberObject(): bool(false) -V8\Uint32Value(V8\Value)->IsStringObject(): bool(false) -V8\Uint32Value(V8\Value)->IsSymbolObject(): bool(false) -V8\Uint32Value(V8\Value)->IsNativeError(): bool(false) -V8\Uint32Value(V8\Value)->IsRegExp(): bool(false) -V8\Uint32Value(V8\Value)->IsAsyncFunction(): bool(false) -V8\Uint32Value(V8\Value)->IsGeneratorFunction(): bool(false) -V8\Uint32Value(V8\Value)->IsGeneratorObject(): bool(false) -V8\Uint32Value(V8\Value)->IsPromise(): bool(false) -V8\Uint32Value(V8\Value)->IsMap(): bool(false) -V8\Uint32Value(V8\Value)->IsSet(): bool(false) -V8\Uint32Value(V8\Value)->IsMapIterator(): bool(false) -V8\Uint32Value(V8\Value)->IsSetIterator(): bool(false) -V8\Uint32Value(V8\Value)->IsWeakMap(): bool(false) -V8\Uint32Value(V8\Value)->IsWeakSet(): bool(false) -V8\Uint32Value(V8\Value)->IsArrayBuffer(): bool(false) -V8\Uint32Value(V8\Value)->IsArrayBufferView(): bool(false) -V8\Uint32Value(V8\Value)->IsTypedArray(): bool(false) -V8\Uint32Value(V8\Value)->IsUint8Array(): bool(false) -V8\Uint32Value(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\Uint32Value(V8\Value)->IsInt8Array(): bool(false) -V8\Uint32Value(V8\Value)->IsUint16Array(): bool(false) -V8\Uint32Value(V8\Value)->IsInt16Array(): bool(false) -V8\Uint32Value(V8\Value)->IsUint32Array(): bool(false) -V8\Uint32Value(V8\Value)->IsInt32Array(): bool(false) -V8\Uint32Value(V8\Value)->IsFloat32Array(): bool(false) -V8\Uint32Value(V8\Value)->IsFloat64Array(): bool(false) -V8\Uint32Value(V8\Value)->IsDataView(): bool(false) -V8\Uint32Value(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\Uint32Value(V8\Value)->IsProxy(): bool(false) - - -V8\Uint32Value::ToString() converting: +V8\Uint32Value(V8\Value)->typeOf(): V8\StringValue->value(): string(6) "number" + +V8\Uint32Value(V8\Value)->isUndefined(): bool(false) +V8\Uint32Value(V8\Value)->isNull(): bool(false) +V8\Uint32Value(V8\Value)->isNullOrUndefined(): bool(false) +V8\Uint32Value(V8\Value)->isTrue(): bool(false) +V8\Uint32Value(V8\Value)->isFalse(): bool(false) +V8\Uint32Value(V8\Value)->isName(): bool(false) +V8\Uint32Value(V8\Value)->isString(): bool(false) +V8\Uint32Value(V8\Value)->isSymbol(): bool(false) +V8\Uint32Value(V8\Value)->isFunction(): bool(false) +V8\Uint32Value(V8\Value)->isArray(): bool(false) +V8\Uint32Value(V8\Value)->isObject(): bool(false) +V8\Uint32Value(V8\Value)->isBoolean(): bool(false) +V8\Uint32Value(V8\Value)->isNumber(): bool(true) +V8\Uint32Value(V8\Value)->isInt32(): bool(false) +V8\Uint32Value(V8\Value)->isUint32(): bool(true) +V8\Uint32Value(V8\Value)->isDate(): bool(false) +V8\Uint32Value(V8\Value)->isArgumentsObject(): bool(false) +V8\Uint32Value(V8\Value)->isBooleanObject(): bool(false) +V8\Uint32Value(V8\Value)->isNumberObject(): bool(false) +V8\Uint32Value(V8\Value)->isStringObject(): bool(false) +V8\Uint32Value(V8\Value)->isSymbolObject(): bool(false) +V8\Uint32Value(V8\Value)->isNativeError(): bool(false) +V8\Uint32Value(V8\Value)->isRegExp(): bool(false) +V8\Uint32Value(V8\Value)->isAsyncFunction(): bool(false) +V8\Uint32Value(V8\Value)->isGeneratorFunction(): bool(false) +V8\Uint32Value(V8\Value)->isGeneratorObject(): bool(false) +V8\Uint32Value(V8\Value)->isPromise(): bool(false) +V8\Uint32Value(V8\Value)->isMap(): bool(false) +V8\Uint32Value(V8\Value)->isSet(): bool(false) +V8\Uint32Value(V8\Value)->isMapIterator(): bool(false) +V8\Uint32Value(V8\Value)->isSetIterator(): bool(false) +V8\Uint32Value(V8\Value)->isWeakMap(): bool(false) +V8\Uint32Value(V8\Value)->isWeakSet(): bool(false) +V8\Uint32Value(V8\Value)->isArrayBuffer(): bool(false) +V8\Uint32Value(V8\Value)->isArrayBufferView(): bool(false) +V8\Uint32Value(V8\Value)->isTypedArray(): bool(false) +V8\Uint32Value(V8\Value)->isUint8Array(): bool(false) +V8\Uint32Value(V8\Value)->isUint8ClampedArray(): bool(false) +V8\Uint32Value(V8\Value)->isInt8Array(): bool(false) +V8\Uint32Value(V8\Value)->isUint16Array(): bool(false) +V8\Uint32Value(V8\Value)->isInt16Array(): bool(false) +V8\Uint32Value(V8\Value)->isUint32Array(): bool(false) +V8\Uint32Value(V8\Value)->isInt32Array(): bool(false) +V8\Uint32Value(V8\Value)->isFloat32Array(): bool(false) +V8\Uint32Value(V8\Value)->isFloat64Array(): bool(false) +V8\Uint32Value(V8\Value)->isDataView(): bool(false) +V8\Uint32Value(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\Uint32Value(V8\Value)->isProxy(): bool(false) + + +V8\Uint32Value::toString() converting: -------------------------------------- object(V8\StringValue)#79 (1) { ["isolate":"V8\Value":private]=> @@ -151,8 +151,8 @@ string(10) "2147483648" Primitive converters: --------------------- -V8\Uint32Value(V8\Value)->BooleanValue(): bool(true) -V8\Uint32Value(V8\Value)->NumberValue(): float(2147483648) +V8\Uint32Value(V8\Value)->booleanValue(): bool(true) +V8\Uint32Value(V8\Value)->numberValue(): float(2147483648) Uint32 is unsingned int32 value, so test for out-of-range (0-UINT32_MAX): diff --git a/tests/V8UnboundScript.phpt b/tests/V8UnboundScript.phpt index 5728c7b..0ec3818 100644 --- a/tests/V8UnboundScript.phpt +++ b/tests/V8UnboundScript.phpt @@ -24,7 +24,7 @@ $file_name = 'test.js'; $script = new V8\Script($context, new \V8\StringValue($isolate, $source), new \V8\ScriptOrigin($file_name)); -$unbound = $script->GetUnboundScript(); +$unbound = $script->getUnboundScript(); $helper->header('UnboundScript representation'); $helper->dump($unbound); @@ -35,35 +35,35 @@ $helper->dump_object_constants($unbound); $helper->space(); $helper->header('Accessors'); -$helper->method_matches($unbound, 'GetIsolate', $isolate); -$helper->method_matches_instanceof($unbound, 'BindToContext', V8\Script::class, [$context]); +$helper->method_matches($unbound, 'getIsolate', $isolate); +$helper->method_matches_instanceof($unbound, 'bindToContext', V8\Script::class, [$context]); -$filter = new ArrayListFilter(['GetId', 'GetScriptName', 'GetSourceURL', 'GetSourceMappingURL'], false); -$finalizer = new CallChainFinalizer([\V8\StringValue::class => 'Value', \V8\UndefinedValue::class => 'IsUndefined'], [], false); +$filter = new ArrayListFilter(['getId', 'getScriptName', 'getSourceURL', 'getSourceMappingURL'], false); +$finalizer = new CallChainFinalizer([\V8\StringValue::class => 'value', \V8\UndefinedValue::class => 'isUndefined'], [], false); $helper->dump_object_methods($unbound, [], $filter, $finalizer); $helper->space(); $helper->header('Getting line number'); -$helper->method_dump($unbound, 'GetLineNumber', [-1]); -$helper->method_dump($unbound, 'GetLineNumber', [0]); -$helper->method_dump($unbound, 'GetLineNumber', [1]); -$helper->method_dump($unbound, 'GetLineNumber', [18]); -$helper->method_dump($unbound, 'GetLineNumber', [19]); -$helper->method_dump($unbound, 'GetLineNumber', [9999]); +$helper->method_dump($unbound, 'getLineNumber', [-1]); +$helper->method_dump($unbound, 'getLineNumber', [0]); +$helper->method_dump($unbound, 'getLineNumber', [1]); +$helper->method_dump($unbound, 'getLineNumber', [18]); +$helper->method_dump($unbound, 'getLineNumber', [19]); +$helper->method_dump($unbound, 'getLineNumber', [9999]); $helper->space(); $helper->header('Get script back'); -$helper->method_matches_instanceof($unbound, 'BindToContext', V8\Script::class, [$context]); +$helper->method_matches_instanceof($unbound, 'bindToContext', V8\Script::class, [$context]); -$new_script = $unbound->BindToContext($context); -$helper->dump($new_script->Run($context)->Value()); +$new_script = $unbound->bindToContext($context); +$helper->dump($new_script->run($context)->value()); $helper->space(); -// EXPECTF: ---/V8\\UnboundScript->GetId\(\): int\(\d+\)/ -// EXPECTF: +++V8\UnboundScript->GetId(): int(%d) +// EXPECTF: ---/V8\\UnboundScript->getId\(\): int\(\d+\)/ +// EXPECTF: +++V8\UnboundScript->getId(): int(%d) ?> --EXPECTF-- UnboundScript representation: @@ -82,25 +82,25 @@ V8\UnboundScript::kNoScriptId = 0 Accessors: ---------- -V8\UnboundScript::GetIsolate() matches expected value -V8\UnboundScript::BindToContext() result is instance of V8\Script -V8\UnboundScript->GetId(): int(%d) -V8\UnboundScript->GetScriptName(): V8\StringValue->Value(): string(7) "test.js" -V8\UnboundScript->GetSourceURL(): V8\UndefinedValue->IsUndefined(): bool(true) -V8\UnboundScript->GetSourceMappingURL(): V8\StringValue->Value(): string(0) "" +V8\UnboundScript::getIsolate() matches expected value +V8\UnboundScript::bindToContext() result is instance of V8\Script +V8\UnboundScript->getId(): int(%d) +V8\UnboundScript->getScriptName(): V8\StringValue->value(): string(7) "test.js" +V8\UnboundScript->getSourceURL(): V8\UndefinedValue->isUndefined(): bool(true) +V8\UnboundScript->getSourceMappingURL(): V8\StringValue->value(): string(0) "" Getting line number: -------------------- -V8\UnboundScript::GetLineNumber() 0 -V8\UnboundScript::GetLineNumber() 0 -V8\UnboundScript::GetLineNumber() 0 -V8\UnboundScript::GetLineNumber() 0 -V8\UnboundScript::GetLineNumber() 1 -V8\UnboundScript::GetLineNumber() -1 +V8\UnboundScript::getLineNumber() 0 +V8\UnboundScript::getLineNumber() 0 +V8\UnboundScript::getLineNumber() 0 +V8\UnboundScript::getLineNumber() 0 +V8\UnboundScript::getLineNumber() 1 +V8\UnboundScript::getLineNumber() -1 Get script back: ---------------- -V8\UnboundScript::BindToContext() result is instance of V8\Script +V8\UnboundScript::bindToContext() result is instance of V8\Script string(11) "test passed" diff --git a/tests/V8Undefined.phpt b/tests/V8Undefined.phpt index b3ebeab..38959e5 100644 --- a/tests/V8Undefined.phpt +++ b/tests/V8Undefined.phpt @@ -25,21 +25,21 @@ $helper->space(); $helper->assert('UndefinedValue extends PrimitiveValue', $value instanceof \V8\PrimitiveValue); $helper->assert('UndefinedValue extends Value', $value instanceof \V8\Value); -$helper->assert('TypeOf returns StringValue', $value->TypeOf() instanceof \V8\StringValue); +$helper->assert('TypeOf returns StringValue', $value->typeOf() instanceof \V8\StringValue); $helper->line(); $helper->header('InstanceOf'); try { - $value->InstanceOf($context, new \V8\ObjectValue($context)); + $value->instanceOf($context, new \V8\ObjectValue($context)); } catch (\V8\Exceptions\TryCatchException $e) { $helper->exception_export($e); } -$helper->assert('Default Value is not an instance of Function', !$value->InstanceOf($context, new \V8\FunctionObject($context, function(){}))); +$helper->assert('Default Value is not an instance of Function', !$value->instanceOf($context, new \V8\FunctionObject($context, function(){}))); $helper->line(); $helper->header('Accessors'); -$helper->method_matches($value, 'GetIsolate', $isolate); -$helper->method_export($value, 'Value'); +$helper->method_matches($value, 'getIsolate', $isolate); +$helper->method_export($value, 'value'); $helper->space(); $v8_helper->run_checks($value); @@ -49,23 +49,23 @@ $context = new \V8\Context($isolate, $global_template); $helper->header('Primitive converters'); -$helper->method_export($value, 'BooleanValue', [$context]); -$helper->method_export($value, 'NumberValue', [$context]); +$helper->method_export($value, 'booleanValue', [$context]); +$helper->method_export($value, 'numberValue', [$context]); $helper->space(); -$string = $value->ToString($context); +$string = $value->toString($context); -$helper->header(get_class($value) .'::ToString() converting'); +$helper->header(get_class($value) .'::toString() converting'); $helper->dump($string); -$helper->dump($string->Value()); +$helper->dump($string->value()); $helper->space(); $v8_helper->run_checks($value, 'Checkers after ToString() converting'); -$helper->header(get_class($value) .'::ToObject() converting'); +$helper->header(get_class($value) .'::toObject() converting'); try { - $object = $value->ToObject($context); + $object = $value->toObject($context); } catch (Exception $e) { $helper->exception_export($e); } @@ -94,71 +94,71 @@ Default Value is not an instance of Function: ok Accessors: ---------- -V8\UndefinedValue::GetIsolate() matches expected value -V8\UndefinedValue->Value(): NULL +V8\UndefinedValue::getIsolate() matches expected value +V8\UndefinedValue->value(): NULL Checks on V8\UndefinedValue: ---------------------------- -V8\UndefinedValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(9) "undefined" - -V8\UndefinedValue(V8\Value)->IsUndefined(): bool(true) -V8\UndefinedValue(V8\Value)->IsNull(): bool(false) -V8\UndefinedValue(V8\Value)->IsNullOrUndefined(): bool(true) -V8\UndefinedValue(V8\Value)->IsTrue(): bool(false) -V8\UndefinedValue(V8\Value)->IsFalse(): bool(false) -V8\UndefinedValue(V8\Value)->IsName(): bool(false) -V8\UndefinedValue(V8\Value)->IsString(): bool(false) -V8\UndefinedValue(V8\Value)->IsSymbol(): bool(false) -V8\UndefinedValue(V8\Value)->IsFunction(): bool(false) -V8\UndefinedValue(V8\Value)->IsArray(): bool(false) -V8\UndefinedValue(V8\Value)->IsObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsBoolean(): bool(false) -V8\UndefinedValue(V8\Value)->IsNumber(): bool(false) -V8\UndefinedValue(V8\Value)->IsInt32(): bool(false) -V8\UndefinedValue(V8\Value)->IsUint32(): bool(false) -V8\UndefinedValue(V8\Value)->IsDate(): bool(false) -V8\UndefinedValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsBooleanObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsNumberObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsStringObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsSymbolObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsNativeError(): bool(false) -V8\UndefinedValue(V8\Value)->IsRegExp(): bool(false) -V8\UndefinedValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\UndefinedValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\UndefinedValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsPromise(): bool(false) -V8\UndefinedValue(V8\Value)->IsMap(): bool(false) -V8\UndefinedValue(V8\Value)->IsSet(): bool(false) -V8\UndefinedValue(V8\Value)->IsMapIterator(): bool(false) -V8\UndefinedValue(V8\Value)->IsSetIterator(): bool(false) -V8\UndefinedValue(V8\Value)->IsWeakMap(): bool(false) -V8\UndefinedValue(V8\Value)->IsWeakSet(): bool(false) -V8\UndefinedValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\UndefinedValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\UndefinedValue(V8\Value)->IsTypedArray(): bool(false) -V8\UndefinedValue(V8\Value)->IsUint8Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\UndefinedValue(V8\Value)->IsInt8Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsUint16Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsInt16Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsUint32Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsInt32Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsFloat32Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsFloat64Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsDataView(): bool(false) -V8\UndefinedValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\UndefinedValue(V8\Value)->IsProxy(): bool(false) +V8\UndefinedValue(V8\Value)->typeOf(): V8\StringValue->value(): string(9) "undefined" + +V8\UndefinedValue(V8\Value)->isUndefined(): bool(true) +V8\UndefinedValue(V8\Value)->isNull(): bool(false) +V8\UndefinedValue(V8\Value)->isNullOrUndefined(): bool(true) +V8\UndefinedValue(V8\Value)->isTrue(): bool(false) +V8\UndefinedValue(V8\Value)->isFalse(): bool(false) +V8\UndefinedValue(V8\Value)->isName(): bool(false) +V8\UndefinedValue(V8\Value)->isString(): bool(false) +V8\UndefinedValue(V8\Value)->isSymbol(): bool(false) +V8\UndefinedValue(V8\Value)->isFunction(): bool(false) +V8\UndefinedValue(V8\Value)->isArray(): bool(false) +V8\UndefinedValue(V8\Value)->isObject(): bool(false) +V8\UndefinedValue(V8\Value)->isBoolean(): bool(false) +V8\UndefinedValue(V8\Value)->isNumber(): bool(false) +V8\UndefinedValue(V8\Value)->isInt32(): bool(false) +V8\UndefinedValue(V8\Value)->isUint32(): bool(false) +V8\UndefinedValue(V8\Value)->isDate(): bool(false) +V8\UndefinedValue(V8\Value)->isArgumentsObject(): bool(false) +V8\UndefinedValue(V8\Value)->isBooleanObject(): bool(false) +V8\UndefinedValue(V8\Value)->isNumberObject(): bool(false) +V8\UndefinedValue(V8\Value)->isStringObject(): bool(false) +V8\UndefinedValue(V8\Value)->isSymbolObject(): bool(false) +V8\UndefinedValue(V8\Value)->isNativeError(): bool(false) +V8\UndefinedValue(V8\Value)->isRegExp(): bool(false) +V8\UndefinedValue(V8\Value)->isAsyncFunction(): bool(false) +V8\UndefinedValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\UndefinedValue(V8\Value)->isGeneratorObject(): bool(false) +V8\UndefinedValue(V8\Value)->isPromise(): bool(false) +V8\UndefinedValue(V8\Value)->isMap(): bool(false) +V8\UndefinedValue(V8\Value)->isSet(): bool(false) +V8\UndefinedValue(V8\Value)->isMapIterator(): bool(false) +V8\UndefinedValue(V8\Value)->isSetIterator(): bool(false) +V8\UndefinedValue(V8\Value)->isWeakMap(): bool(false) +V8\UndefinedValue(V8\Value)->isWeakSet(): bool(false) +V8\UndefinedValue(V8\Value)->isArrayBuffer(): bool(false) +V8\UndefinedValue(V8\Value)->isArrayBufferView(): bool(false) +V8\UndefinedValue(V8\Value)->isTypedArray(): bool(false) +V8\UndefinedValue(V8\Value)->isUint8Array(): bool(false) +V8\UndefinedValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\UndefinedValue(V8\Value)->isInt8Array(): bool(false) +V8\UndefinedValue(V8\Value)->isUint16Array(): bool(false) +V8\UndefinedValue(V8\Value)->isInt16Array(): bool(false) +V8\UndefinedValue(V8\Value)->isUint32Array(): bool(false) +V8\UndefinedValue(V8\Value)->isInt32Array(): bool(false) +V8\UndefinedValue(V8\Value)->isFloat32Array(): bool(false) +V8\UndefinedValue(V8\Value)->isFloat64Array(): bool(false) +V8\UndefinedValue(V8\Value)->isDataView(): bool(false) +V8\UndefinedValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\UndefinedValue(V8\Value)->isProxy(): bool(false) Primitive converters: --------------------- -V8\UndefinedValue(V8\Value)->BooleanValue(): bool(false) -V8\UndefinedValue(V8\Value)->NumberValue(): float(NAN) +V8\UndefinedValue(V8\Value)->booleanValue(): bool(false) +V8\UndefinedValue(V8\Value)->numberValue(): float(NAN) -V8\UndefinedValue::ToString() converting: +V8\UndefinedValue::toString() converting: ----------------------------------------- object(V8\StringValue)#89 (1) { ["isolate":"V8\Value":private]=> @@ -170,58 +170,58 @@ string(9) "undefined" Checkers after ToString() converting: ------------------------------------- -V8\UndefinedValue(V8\Value)->TypeOf(): V8\StringValue->Value(): string(9) "undefined" - -V8\UndefinedValue(V8\Value)->IsUndefined(): bool(true) -V8\UndefinedValue(V8\Value)->IsNull(): bool(false) -V8\UndefinedValue(V8\Value)->IsNullOrUndefined(): bool(true) -V8\UndefinedValue(V8\Value)->IsTrue(): bool(false) -V8\UndefinedValue(V8\Value)->IsFalse(): bool(false) -V8\UndefinedValue(V8\Value)->IsName(): bool(false) -V8\UndefinedValue(V8\Value)->IsString(): bool(false) -V8\UndefinedValue(V8\Value)->IsSymbol(): bool(false) -V8\UndefinedValue(V8\Value)->IsFunction(): bool(false) -V8\UndefinedValue(V8\Value)->IsArray(): bool(false) -V8\UndefinedValue(V8\Value)->IsObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsBoolean(): bool(false) -V8\UndefinedValue(V8\Value)->IsNumber(): bool(false) -V8\UndefinedValue(V8\Value)->IsInt32(): bool(false) -V8\UndefinedValue(V8\Value)->IsUint32(): bool(false) -V8\UndefinedValue(V8\Value)->IsDate(): bool(false) -V8\UndefinedValue(V8\Value)->IsArgumentsObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsBooleanObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsNumberObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsStringObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsSymbolObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsNativeError(): bool(false) -V8\UndefinedValue(V8\Value)->IsRegExp(): bool(false) -V8\UndefinedValue(V8\Value)->IsAsyncFunction(): bool(false) -V8\UndefinedValue(V8\Value)->IsGeneratorFunction(): bool(false) -V8\UndefinedValue(V8\Value)->IsGeneratorObject(): bool(false) -V8\UndefinedValue(V8\Value)->IsPromise(): bool(false) -V8\UndefinedValue(V8\Value)->IsMap(): bool(false) -V8\UndefinedValue(V8\Value)->IsSet(): bool(false) -V8\UndefinedValue(V8\Value)->IsMapIterator(): bool(false) -V8\UndefinedValue(V8\Value)->IsSetIterator(): bool(false) -V8\UndefinedValue(V8\Value)->IsWeakMap(): bool(false) -V8\UndefinedValue(V8\Value)->IsWeakSet(): bool(false) -V8\UndefinedValue(V8\Value)->IsArrayBuffer(): bool(false) -V8\UndefinedValue(V8\Value)->IsArrayBufferView(): bool(false) -V8\UndefinedValue(V8\Value)->IsTypedArray(): bool(false) -V8\UndefinedValue(V8\Value)->IsUint8Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsUint8ClampedArray(): bool(false) -V8\UndefinedValue(V8\Value)->IsInt8Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsUint16Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsInt16Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsUint32Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsInt32Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsFloat32Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsFloat64Array(): bool(false) -V8\UndefinedValue(V8\Value)->IsDataView(): bool(false) -V8\UndefinedValue(V8\Value)->IsSharedArrayBuffer(): bool(false) -V8\UndefinedValue(V8\Value)->IsProxy(): bool(false) - - -V8\UndefinedValue::ToObject() converting: +V8\UndefinedValue(V8\Value)->typeOf(): V8\StringValue->value(): string(9) "undefined" + +V8\UndefinedValue(V8\Value)->isUndefined(): bool(true) +V8\UndefinedValue(V8\Value)->isNull(): bool(false) +V8\UndefinedValue(V8\Value)->isNullOrUndefined(): bool(true) +V8\UndefinedValue(V8\Value)->isTrue(): bool(false) +V8\UndefinedValue(V8\Value)->isFalse(): bool(false) +V8\UndefinedValue(V8\Value)->isName(): bool(false) +V8\UndefinedValue(V8\Value)->isString(): bool(false) +V8\UndefinedValue(V8\Value)->isSymbol(): bool(false) +V8\UndefinedValue(V8\Value)->isFunction(): bool(false) +V8\UndefinedValue(V8\Value)->isArray(): bool(false) +V8\UndefinedValue(V8\Value)->isObject(): bool(false) +V8\UndefinedValue(V8\Value)->isBoolean(): bool(false) +V8\UndefinedValue(V8\Value)->isNumber(): bool(false) +V8\UndefinedValue(V8\Value)->isInt32(): bool(false) +V8\UndefinedValue(V8\Value)->isUint32(): bool(false) +V8\UndefinedValue(V8\Value)->isDate(): bool(false) +V8\UndefinedValue(V8\Value)->isArgumentsObject(): bool(false) +V8\UndefinedValue(V8\Value)->isBooleanObject(): bool(false) +V8\UndefinedValue(V8\Value)->isNumberObject(): bool(false) +V8\UndefinedValue(V8\Value)->isStringObject(): bool(false) +V8\UndefinedValue(V8\Value)->isSymbolObject(): bool(false) +V8\UndefinedValue(V8\Value)->isNativeError(): bool(false) +V8\UndefinedValue(V8\Value)->isRegExp(): bool(false) +V8\UndefinedValue(V8\Value)->isAsyncFunction(): bool(false) +V8\UndefinedValue(V8\Value)->isGeneratorFunction(): bool(false) +V8\UndefinedValue(V8\Value)->isGeneratorObject(): bool(false) +V8\UndefinedValue(V8\Value)->isPromise(): bool(false) +V8\UndefinedValue(V8\Value)->isMap(): bool(false) +V8\UndefinedValue(V8\Value)->isSet(): bool(false) +V8\UndefinedValue(V8\Value)->isMapIterator(): bool(false) +V8\UndefinedValue(V8\Value)->isSetIterator(): bool(false) +V8\UndefinedValue(V8\Value)->isWeakMap(): bool(false) +V8\UndefinedValue(V8\Value)->isWeakSet(): bool(false) +V8\UndefinedValue(V8\Value)->isArrayBuffer(): bool(false) +V8\UndefinedValue(V8\Value)->isArrayBufferView(): bool(false) +V8\UndefinedValue(V8\Value)->isTypedArray(): bool(false) +V8\UndefinedValue(V8\Value)->isUint8Array(): bool(false) +V8\UndefinedValue(V8\Value)->isUint8ClampedArray(): bool(false) +V8\UndefinedValue(V8\Value)->isInt8Array(): bool(false) +V8\UndefinedValue(V8\Value)->isUint16Array(): bool(false) +V8\UndefinedValue(V8\Value)->isInt16Array(): bool(false) +V8\UndefinedValue(V8\Value)->isUint32Array(): bool(false) +V8\UndefinedValue(V8\Value)->isInt32Array(): bool(false) +V8\UndefinedValue(V8\Value)->isFloat32Array(): bool(false) +V8\UndefinedValue(V8\Value)->isFloat64Array(): bool(false) +V8\UndefinedValue(V8\Value)->isDataView(): bool(false) +V8\UndefinedValue(V8\Value)->isSharedArrayBuffer(): bool(false) +V8\UndefinedValue(V8\Value)->isProxy(): bool(false) + + +V8\UndefinedValue::toObject() converting: ----------------------------------------- V8\Exceptions\TryCatchException: TypeError: Cannot convert undefined or null to object diff --git a/tests/V8Value_empty.phpt b/tests/V8Value_empty.phpt index d1710f9..f088a1c 100644 --- a/tests/V8Value_empty.phpt +++ b/tests/V8Value_empty.phpt @@ -25,12 +25,12 @@ $bad = new class extends \V8\Value { }; try { - $bad->BooleanValue($context); + $bad->booleanValue($context); } catch (Throwable $e) { $helper->exception_export($e); } try { - $bad->GetIsolate(); + $bad->getIsolate(); } catch (Throwable $e) { $helper->exception_export($e); } From 943710ac07305f0871352ab9dad89ec15a512b11 Mon Sep 17 00:00:00 2001 From: Bogdan Padalko Date: Wed, 30 Aug 2017 23:58:54 +0300 Subject: [PATCH 2/2] Refactor internals to shorten arginfo functions name --- php_v8.h | 3 + src/php_v8_array.cc | 9 +- src/php_v8_boolean.cc | 8 +- src/php_v8_boolean_object.cc | 9 +- src/php_v8_cached_data.cc | 12 +- src/php_v8_callback_info.cc | 20 +- src/php_v8_context.cc | 40 ++-- src/php_v8_date.cc | 13 +- src/php_v8_exception.cc | 29 ++- src/php_v8_exceptions.cc | 23 +-- src/php_v8_ext_mem_interface.cc | 8 +- src/php_v8_function.cc | 46 ++--- src/php_v8_function_callback_info.cc | 20 +- src/php_v8_function_template.cc | 80 ++++---- src/php_v8_heap_statistics.cc | 52 ++--- ..._indexed_property_handler_configuration.cc | 4 +- src/php_v8_int32.cc | 9 +- src/php_v8_integer.cc | 8 +- src/php_v8_isolate.cc | 83 ++++---- src/php_v8_map.cc | 35 ++-- src/php_v8_message.cc | 57 +++--- src/php_v8_name.cc | 4 +- ...v8_named_property_handler_configuration.cc | 4 +- src/php_v8_null.cc | 8 +- src/php_v8_number.cc | 8 +- src/php_v8_number_object.cc | 9 +- src/php_v8_object.cc | 165 ++++++++------- src/php_v8_object_template.cc | 53 +++-- src/php_v8_property_callback_info.cc | 4 +- src/php_v8_regexp.cc | 23 +-- src/php_v8_return_value.cc | 45 +++-- src/php_v8_script.cc | 21 +- src/php_v8_script_compiler.cc | 16 +- src/php_v8_script_origin.cc | 29 ++- src/php_v8_script_origin_options.cc | 21 +- src/php_v8_set.cc | 31 ++- src/php_v8_source.cc | 16 +- src/php_v8_stack_frame.cc | 39 ++-- src/php_v8_stack_trace.cc | 23 +-- src/php_v8_startup_data.cc | 18 +- src/php_v8_string.cc | 25 +-- src/php_v8_string_object.cc | 9 +- src/php_v8_symbol.cc | 63 +++--- src/php_v8_symbol_object.cc | 9 +- src/php_v8_template.cc | 16 +- src/php_v8_try_catch.cc | 41 ++-- src/php_v8_uint32.cc | 8 +- src/php_v8_unbound_script.cc | 32 +-- src/php_v8_undefined.cc | 8 +- src/php_v8_value.cc | 189 +++++++++--------- 50 files changed, 726 insertions(+), 779 deletions(-) diff --git a/php_v8.h b/php_v8.h index 092276c..3d4828f 100644 --- a/php_v8.h +++ b/php_v8.h @@ -77,6 +77,9 @@ ZEND_END_MODULE_GLOBALS(v8) #define PHP_V8_IS_UP_AND_RUNNING() (zend_is_executing() && !CG(unclean_shutdown)) +#define PHP_V8_ME(classname, name, flags) PHP_ME(classname, name, arginfo_##name, flags) +#define PHP_V8_ABSTRACT_ME(classname, name) PHP_ABSTRACT_ME(classname, name, arginfo_##name) + /* Always refer to the globals in your function as PHP_V8_G(variable). You are encouraged to rename these macros something shorter, see examples in any other php module directory. diff --git a/src/php_v8_array.cc b/src/php_v8_array.cc index 4c37d1f..27140f5 100644 --- a/src/php_v8_array.cc +++ b/src/php_v8_array.cc @@ -60,19 +60,18 @@ static PHP_METHOD(Array, length) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_array___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_array_length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_array_methods[] = { - PHP_ME(Array, __construct, arginfo_array___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(Array, length, arginfo_array_length, ZEND_ACC_PUBLIC) + PHP_V8_ME(Array, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Array, length, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_boolean.cc b/src/php_v8_boolean.cc index 047761e..1aeee87 100644 --- a/src/php_v8_boolean.cc +++ b/src/php_v8_boolean.cc @@ -55,18 +55,18 @@ static PHP_METHOD(BooleanValue, value) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_boolean___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_TYPE_INFO(0, value, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_boolean_value, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_boolean_methods[] = { - PHP_ME(BooleanValue, __construct, arginfo_boolean___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(BooleanValue, value, arginfo_boolean_value, ZEND_ACC_PUBLIC) + PHP_V8_ME(BooleanValue, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(BooleanValue, value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_boolean_object.cc b/src/php_v8_boolean_object.cc index 5b3f29a..ec2b475 100644 --- a/src/php_v8_boolean_object.cc +++ b/src/php_v8_boolean_object.cc @@ -58,19 +58,18 @@ static PHP_METHOD(BooleanObject, valueOf) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_boolean_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_TYPE_INFO(0, value, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_boolean_object_valueOf, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_valueOf, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_boolean_object_methods[] = { - PHP_ME(BooleanObject, __construct, arginfo_boolean_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(BooleanObject, valueOf, arginfo_boolean_object_valueOf, ZEND_ACC_PUBLIC) + PHP_V8_ME(BooleanObject, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(BooleanObject, valueOf, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_cached_data.cc b/src/php_v8_cached_data.cc index 57ea7af..0b8c0fa 100644 --- a/src/php_v8_cached_data.cc +++ b/src/php_v8_cached_data.cc @@ -106,21 +106,21 @@ static PHP_METHOD(CachedData, isRejected) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_cached_data___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_cached_data_getData, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getData, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_cached_data_isRejected, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isRejected, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_cached_data_methods[] = { - PHP_ME(CachedData, __construct, arginfo_cached_data___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(CachedData, getData, arginfo_cached_data_getData, ZEND_ACC_PUBLIC) - PHP_ME(CachedData, isRejected, arginfo_cached_data_isRejected, ZEND_ACC_PUBLIC) + PHP_V8_ME(CachedData, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(CachedData, getData, ZEND_ACC_PUBLIC) + PHP_V8_ME(CachedData, isRejected, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_callback_info.cc b/src/php_v8_callback_info.cc index a9ee345..6ffd112 100644 --- a/src/php_v8_callback_info.cc +++ b/src/php_v8_callback_info.cc @@ -86,27 +86,27 @@ static PHP_METHOD(CallbackInfo, getReturnValue) { ZVAL_COPY(return_value, tmp); } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_callback_info_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_callback_info_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_callback_info_this, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_this, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_callback_info_holder, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_holder, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_callback_info_getReturnValue, ZEND_RETURN_VALUE, 0, V8\\ReturnValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getReturnValue, ZEND_RETURN_VALUE, 0, V8\\ReturnValue, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_callback_info_methods[] = { - PHP_ME(CallbackInfo, this, arginfo_callback_info_this, ZEND_ACC_PUBLIC) - PHP_ME(CallbackInfo, holder, arginfo_callback_info_holder, ZEND_ACC_PUBLIC) - PHP_ME(CallbackInfo, getIsolate, arginfo_callback_info_getIsolate, ZEND_ACC_PUBLIC) - PHP_ME(CallbackInfo, getContext, arginfo_callback_info_getContext, ZEND_ACC_PUBLIC) - PHP_ME(CallbackInfo, getReturnValue, arginfo_callback_info_getReturnValue, ZEND_ACC_PUBLIC) + PHP_V8_ME(CallbackInfo, this, ZEND_ACC_PUBLIC) + PHP_V8_ME(CallbackInfo, holder, ZEND_ACC_PUBLIC) + PHP_V8_ME(CallbackInfo, getIsolate, ZEND_ACC_PUBLIC) + PHP_V8_ME(CallbackInfo, getContext, ZEND_ACC_PUBLIC) + PHP_V8_ME(CallbackInfo, getReturnValue, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_context.cc b/src/php_v8_context.cc index 617f407..98cb0fe 100644 --- a/src/php_v8_context.cc +++ b/src/php_v8_context.cc @@ -262,63 +262,63 @@ static PHP_METHOD(Context, setErrorMessageForCodeGenerationFromStrings) context->SetErrorMessageForCodeGenerationFromStrings(local_string); } -ZEND_BEGIN_ARG_INFO_EX(arginfo_context___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_OBJ_INFO(0, global_template, V8\\ObjectTemplate, 1) ZEND_ARG_OBJ_INFO(0, global_object, V8\\ObjectValue, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_context_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_context_globalObject, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_globalObject, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_context_detachGlobal, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_detachGlobal, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_context_setSecurityToken, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setSecurityToken, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, token, V8\\Value, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_context_useDefaultSecurityToken, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_useDefaultSecurityToken, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_context_getSecurityToken, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getSecurityToken, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_context_allowCodeGenerationFromStrings, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_allowCodeGenerationFromStrings, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, allow, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_context_isCodeGenerationFromStringsAllowed, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isCodeGenerationFromStringsAllowed, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_context_setErrorMessageForCodeGenerationFromStrings, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setErrorMessageForCodeGenerationFromStrings, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, message, V8\\StringValue, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_context_methods[] = { - PHP_ME(Context, __construct, arginfo_context___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(Context, getIsolate, arginfo_context_getIsolate, ZEND_ACC_PUBLIC) + PHP_V8_ME(Context, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Context, getIsolate, ZEND_ACC_PUBLIC) - PHP_ME(Context, globalObject, arginfo_context_globalObject, ZEND_ACC_PUBLIC) - PHP_ME(Context, detachGlobal, arginfo_context_detachGlobal, ZEND_ACC_PUBLIC) + PHP_V8_ME(Context, globalObject, ZEND_ACC_PUBLIC) + PHP_V8_ME(Context, detachGlobal, ZEND_ACC_PUBLIC) - PHP_ME(Context, setSecurityToken, arginfo_context_setSecurityToken, ZEND_ACC_PUBLIC) - PHP_ME(Context, useDefaultSecurityToken, arginfo_context_useDefaultSecurityToken, ZEND_ACC_PUBLIC) - PHP_ME(Context, getSecurityToken, arginfo_context_getSecurityToken, ZEND_ACC_PUBLIC) + PHP_V8_ME(Context, setSecurityToken, ZEND_ACC_PUBLIC) + PHP_V8_ME(Context, useDefaultSecurityToken, ZEND_ACC_PUBLIC) + PHP_V8_ME(Context, getSecurityToken, ZEND_ACC_PUBLIC) - PHP_ME(Context, allowCodeGenerationFromStrings, arginfo_context_allowCodeGenerationFromStrings, ZEND_ACC_PUBLIC) - PHP_ME(Context, isCodeGenerationFromStringsAllowed, arginfo_context_isCodeGenerationFromStringsAllowed, ZEND_ACC_PUBLIC) - PHP_ME(Context, setErrorMessageForCodeGenerationFromStrings, arginfo_context_setErrorMessageForCodeGenerationFromStrings, ZEND_ACC_PUBLIC) + PHP_V8_ME(Context, allowCodeGenerationFromStrings, ZEND_ACC_PUBLIC) + PHP_V8_ME(Context, isCodeGenerationFromStringsAllowed, ZEND_ACC_PUBLIC) + PHP_V8_ME(Context, setErrorMessageForCodeGenerationFromStrings, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_date.cc b/src/php_v8_date.cc index 7033b4b..a98ea9f 100644 --- a/src/php_v8_date.cc +++ b/src/php_v8_date.cc @@ -72,26 +72,25 @@ static PHP_METHOD(Date, dateTimeConfigurationChangeNotification) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_date___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_TYPE_INFO(0, time, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_date_valueOf, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_valueOf, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_date_dateTimeConfigurationChangeNotification, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_dateTimeConfigurationChangeNotification, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\isolate, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_date_methods[] = { - PHP_ME(Date, __construct, arginfo_date___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Date, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Date, valueOf, ZEND_ACC_PUBLIC) - PHP_ME(Date, valueOf, arginfo_date_valueOf, ZEND_ACC_PUBLIC) - - PHP_ME(Date, dateTimeConfigurationChangeNotification, arginfo_date_dateTimeConfigurationChangeNotification, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Date, dateTimeConfigurationChangeNotification, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/src/php_v8_exception.cc b/src/php_v8_exception.cc index 56ccd0d..071d63f 100644 --- a/src/php_v8_exception.cc +++ b/src/php_v8_exception.cc @@ -191,50 +191,49 @@ static PHP_METHOD(Exception, getStackTrace) { } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_rangeError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_rangeError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, message, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_referenceError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_referenceError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, message, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_syntaxError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_syntaxError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, message, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_typeError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_typeError, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, message, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_error, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_error, ZEND_RETURN_VALUE, 2, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, message, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_createMessage, ZEND_RETURN_VALUE, 2, V8\\Message, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_createMessage, ZEND_RETURN_VALUE, 2, V8\\Message, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, exception, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception_getStackTrace, ZEND_RETURN_VALUE, 2, V8\\StackTrace, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getStackTrace, ZEND_RETURN_VALUE, 2, V8\\StackTrace, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, exception, V8\\Value, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_exception_methods[] = { - PHP_ME(Exception, rangeError, arginfo_exception_rangeError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Exception, referenceError, arginfo_exception_referenceError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Exception, syntaxError, arginfo_exception_syntaxError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Exception, typeError, arginfo_exception_typeError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Exception, error, arginfo_exception_error, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - - PHP_ME(Exception, createMessage, arginfo_exception_createMessage, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Exception, getStackTrace, arginfo_exception_getStackTrace, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Exception, rangeError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Exception, referenceError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Exception, syntaxError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Exception, typeError, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Exception, error, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Exception, createMessage, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Exception, getStackTrace, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/src/php_v8_exceptions.cc b/src/php_v8_exceptions.cc index 9acf5a1..3503cf0 100644 --- a/src/php_v8_exceptions.cc +++ b/src/php_v8_exceptions.cc @@ -154,19 +154,19 @@ static PHP_METHOD(ExceptionsTryCatch, getTryCatch) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_exceptions_try_catch___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 3) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 3) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, try_catch, V8\\TryCatch, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exceptions_try_catch_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exceptions_try_catch_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exceptions_try_catch_getTryCatch, ZEND_RETURN_VALUE, 0, V8\\TryCatch, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getTryCatch, ZEND_RETURN_VALUE, 0, V8\\TryCatch, 0) ZEND_END_ARG_INFO() @@ -176,11 +176,10 @@ static const zend_function_entry php_v8_exception_methods[] = { }; static const zend_function_entry php_v8_try_catch_exception_methods[] = { - PHP_ME(ExceptionsTryCatch, __construct, arginfo_exceptions_try_catch___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(ExceptionsTryCatch, getIsolate, arginfo_exceptions_try_catch_getIsolate, ZEND_ACC_PUBLIC) - PHP_ME(ExceptionsTryCatch, getContext, arginfo_exceptions_try_catch_getContext, ZEND_ACC_PUBLIC) - PHP_ME(ExceptionsTryCatch, getTryCatch, arginfo_exceptions_try_catch_getTryCatch, ZEND_ACC_PUBLIC) + PHP_V8_ME(ExceptionsTryCatch, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(ExceptionsTryCatch, getIsolate, ZEND_ACC_PUBLIC) + PHP_V8_ME(ExceptionsTryCatch, getContext, ZEND_ACC_PUBLIC) + PHP_V8_ME(ExceptionsTryCatch, getTryCatch, ZEND_ACC_PUBLIC) PHP_FE_END }; @@ -216,9 +215,9 @@ PHP_MINIT_FUNCTION(php_v8_exceptions) { INIT_NS_CLASS_ENTRY(ce, "V8\\Exceptions", "TryCatchException", php_v8_try_catch_exception_methods); php_v8_try_catch_exception_class_entry = zend_register_internal_class_ex(&ce, php_v8_generic_exception_class_entry); - zend_declare_property_null(php_v8_try_catch_exception_class_entry, ZEND_STRL("isolate"), ZEND_ACC_PRIVATE); - zend_declare_property_null(php_v8_try_catch_exception_class_entry, ZEND_STRL("context"), ZEND_ACC_PRIVATE); - zend_declare_property_null(php_v8_try_catch_exception_class_entry, ZEND_STRL("try_catch"), ZEND_ACC_PRIVATE); + zend_declare_property_null(php_v8_try_catch_exception_class_entry, ZEND_STRL("isolate"), ZEND_ACC_PRIVATE); + zend_declare_property_null(php_v8_try_catch_exception_class_entry, ZEND_STRL("context"), ZEND_ACC_PRIVATE); + zend_declare_property_null(php_v8_try_catch_exception_class_entry, ZEND_STRL("try_catch"), ZEND_ACC_PRIVATE); INIT_NS_CLASS_ENTRY(ce, "V8\\Exceptions", "TerminationException", php_v8_termination_exception_methods); diff --git a/src/php_v8_ext_mem_interface.cc b/src/php_v8_ext_mem_interface.cc index cb65532..2f81a1d 100644 --- a/src/php_v8_ext_mem_interface.cc +++ b/src/php_v8_ext_mem_interface.cc @@ -91,18 +91,18 @@ void php_v8_ext_mem_interface_object_template_GetExternalAllocatedMemory(INTERNA } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_ext_mem_interface_adjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_adjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, change_in_bytes, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_ext_mem_interface_getExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_ext_mem_interface_methods[] = { - PHP_ABSTRACT_ME(AdjustableExternalMemoryInterface, adjustExternalAllocatedMemory, arginfo_php_v8_ext_mem_interface_adjustExternalAllocatedMemory) - PHP_ABSTRACT_ME(AdjustableExternalMemoryInterface, getExternalAllocatedMemory, arginfo_php_v8_ext_mem_interface_getExternalAllocatedMemory) + PHP_V8_ABSTRACT_ME(AdjustableExternalMemoryInterface, adjustExternalAllocatedMemory) + PHP_V8_ABSTRACT_ME(AdjustableExternalMemoryInterface, getExternalAllocatedMemory) PHP_FE_END }; diff --git a/src/php_v8_function.cc b/src/php_v8_function.cc index 9adcde5..680aba4 100644 --- a/src/php_v8_function.cc +++ b/src/php_v8_function.cc @@ -574,65 +574,63 @@ static PHP_METHOD(Function, getScriptOrigin) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_function___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_CALLABLE_INFO(0, callback, 0) ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_newInstance, ZEND_RETURN_VALUE, 1, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_newInstance, ZEND_RETURN_VALUE, 1, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_ARRAY_INFO(0, arguments, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_call, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_call, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, recv, V8\\Value, 0) ZEND_ARG_ARRAY_INFO(0, arguments, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_function_setName, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setName, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, name, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_getName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_getInferredName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getInferredName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_getDisplayName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getDisplayName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() // long or null -ZEND_BEGIN_ARG_INFO_EX(arginfo_function_getScriptLineNumber, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_getScriptLineNumber, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() // long or null -ZEND_BEGIN_ARG_INFO_EX(arginfo_function_getScriptColumnNumber, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_getScriptColumnNumber, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_getBoundFunction, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getBoundFunction, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_getScriptOrigin, ZEND_RETURN_VALUE, 0, V8\\ScriptOrigin, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getScriptOrigin, ZEND_RETURN_VALUE, 0, V8\\ScriptOrigin, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_object_methods[] = { - PHP_ME(Function, __construct, arginfo_function___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(Function, newInstance, arginfo_function_newInstance, ZEND_ACC_PUBLIC) - PHP_ME(Function, call, arginfo_function_call, ZEND_ACC_PUBLIC) - PHP_ME(Function, setName, arginfo_function_setName, ZEND_ACC_PUBLIC) - PHP_ME(Function, getName, arginfo_function_getName, ZEND_ACC_PUBLIC) - PHP_ME(Function, getInferredName, arginfo_function_getInferredName, ZEND_ACC_PUBLIC) - PHP_ME(Function, getDisplayName, arginfo_function_getDisplayName, ZEND_ACC_PUBLIC) - - PHP_ME(Function, getScriptLineNumber, arginfo_function_getScriptLineNumber, ZEND_ACC_PUBLIC) - PHP_ME(Function, getScriptColumnNumber, arginfo_function_getScriptColumnNumber, ZEND_ACC_PUBLIC) - - PHP_ME(Function, getBoundFunction, arginfo_function_getBoundFunction, ZEND_ACC_PUBLIC) - PHP_ME(Function, getScriptOrigin, arginfo_function_getScriptOrigin, ZEND_ACC_PUBLIC) + PHP_V8_ME(Function, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Function, newInstance, ZEND_ACC_PUBLIC) + PHP_V8_ME(Function, call, ZEND_ACC_PUBLIC) + PHP_V8_ME(Function, setName, ZEND_ACC_PUBLIC) + PHP_V8_ME(Function, getName, ZEND_ACC_PUBLIC) + PHP_V8_ME(Function, getInferredName, ZEND_ACC_PUBLIC) + PHP_V8_ME(Function, getDisplayName, ZEND_ACC_PUBLIC) + PHP_V8_ME(Function, getScriptLineNumber, ZEND_ACC_PUBLIC) + PHP_V8_ME(Function, getScriptColumnNumber, ZEND_ACC_PUBLIC) + PHP_V8_ME(Function, getBoundFunction, ZEND_ACC_PUBLIC) + PHP_V8_ME(Function, getScriptOrigin, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_function_callback_info.cc b/src/php_v8_function_callback_info.cc index 4c152dc..d097e7f 100644 --- a/src/php_v8_function_callback_info.cc +++ b/src/php_v8_function_callback_info.cc @@ -136,24 +136,24 @@ static PHP_METHOD(FunctionCallbackInfo, isConstructCall) { } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_function_callback_info_length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_function_callback_info_arguments, ZEND_RETURN_VALUE, 0, IS_ARRAY, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_arguments, ZEND_RETURN_VALUE, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_callback_info_newTarget, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_newTarget, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_function_callback_info_isConstructCall, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isConstructCall, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_function_callback_info_methods[] = { - PHP_ME(FunctionCallbackInfo, length, arginfo_function_callback_info_length, ZEND_ACC_PUBLIC) - PHP_ME(FunctionCallbackInfo, arguments, arginfo_function_callback_info_arguments, ZEND_ACC_PUBLIC) - PHP_ME(FunctionCallbackInfo, newTarget, arginfo_function_callback_info_newTarget, ZEND_ACC_PUBLIC) - PHP_ME(FunctionCallbackInfo, isConstructCall, arginfo_function_callback_info_isConstructCall, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionCallbackInfo, length, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionCallbackInfo, arguments, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionCallbackInfo, newTarget, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionCallbackInfo, isConstructCall, ZEND_ACC_PUBLIC) PHP_FE_END }; @@ -163,8 +163,8 @@ PHP_MINIT_FUNCTION(php_v8_function_callback_info) { INIT_NS_CLASS_ENTRY(ce, PHP_V8_NS, "FunctionCallbackInfo", php_v8_function_callback_info_methods); this_ce = zend_register_internal_class_ex(&ce, php_v8_callback_info_class_entry); - zend_declare_property_null(this_ce, ZEND_STRL("arguments"), ZEND_ACC_PRIVATE); - zend_declare_property_null(this_ce, ZEND_STRL("new_target"), ZEND_ACC_PRIVATE); + zend_declare_property_null(this_ce, ZEND_STRL("arguments"), ZEND_ACC_PRIVATE); + zend_declare_property_null(this_ce, ZEND_STRL("new_target"), ZEND_ACC_PRIVATE); zend_declare_property_null(this_ce, ZEND_STRL("is_constructor_call"), ZEND_ACC_PRIVATE); return SUCCESS; diff --git a/src/php_v8_function_template.cc b/src/php_v8_function_template.cc index 90ef68a..2ebaba8 100644 --- a/src/php_v8_function_template.cc +++ b/src/php_v8_function_template.cc @@ -450,7 +450,7 @@ static PHP_METHOD(FunctionTemplate, getExternalAllocatedMemory) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_CALLABLE_INFO(0, callback, 1) ZEND_ARG_OBJ_INFO(0, receiver, V8\\FunctionTemplate, 1) @@ -458,18 +458,18 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template___construct, ZEND_SEND_BY_VAL, ZEND_ARG_TYPE_INFO(0, behavior, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_template_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Data, 0) ZEND_ARG_TYPE_INFO(0, attributes, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_setAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, getter, V8\\FunctionTemplate, 0) ZEND_ARG_OBJ_INFO(0, setter, V8\\FunctionTemplate, 0) @@ -477,7 +477,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_setAccessorProperty, ZEN ZEND_ARG_TYPE_INFO(0, settings, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_setNativeDataProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setNativeDataProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_CALLABLE_INFO(0, getter, 0) ZEND_ARG_CALLABLE_INFO(0, setter, 1) @@ -488,90 +488,88 @@ ZEND_END_ARG_INFO() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_function_template_getFunction, ZEND_RETURN_VALUE, 1, V8\\FunctionObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getFunction, ZEND_RETURN_VALUE, 1, V8\\FunctionObject, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_setCallHandler, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setCallHandler, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_CALLABLE_INFO(0, callback, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_function_template_setLength, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setLength, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, length, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_template_instanceTemplate, ZEND_RETURN_VALUE, 0, V8\\ObjectTemplate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_instanceTemplate, ZEND_RETURN_VALUE, 0, V8\\ObjectTemplate, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template_inherit, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_inherit, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, parent, V8\\FunctionTemplate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_function_template_prototypeTemplate, ZEND_RETURN_VALUE, 0, V8\\ObjectTemplate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_prototypeTemplate, ZEND_RETURN_VALUE, 0, V8\\ObjectTemplate, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template_setClassName, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setClassName, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, name, V8\\StringValue, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template_setAcceptAnyReceiver, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setAcceptAnyReceiver, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, value, _IS_BOOL, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template_setHiddenPrototype, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setHiddenPrototype, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, value, _IS_BOOL, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template_readOnlyPrototype, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_readOnlyPrototype, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_function_template_removePrototype, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_removePrototype, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_function_template_hasInstance, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hasInstance, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, object, V8\\ObjectValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_function_template_adjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_adjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, change_in_bytes, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_function_template_getExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_function_template_methods[] = { - PHP_ME(FunctionTemplate, __construct, arginfo_function_template___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(FunctionTemplate, getIsolate, arginfo_function_template_getIsolate, ZEND_ACC_PUBLIC) - - PHP_ME(FunctionTemplate, set, arginfo_php_v8_function_template_set, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, setAccessorProperty, arginfo_php_v8_function_template_setAccessorProperty, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, setNativeDataProperty, arginfo_php_v8_function_template_setNativeDataProperty, ZEND_ACC_PUBLIC) - - PHP_ME(FunctionTemplate, getFunction, arginfo_php_v8_function_template_getFunction, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, setCallHandler, arginfo_php_v8_function_template_setCallHandler, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, setLength, arginfo_php_v8_function_template_setLength, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, instanceTemplate, arginfo_function_template_instanceTemplate, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, inherit, arginfo_function_template_inherit, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, prototypeTemplate, arginfo_function_template_prototypeTemplate, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, setClassName, arginfo_function_template_setClassName, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, setAcceptAnyReceiver, arginfo_function_template_setAcceptAnyReceiver, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, setHiddenPrototype, arginfo_function_template_setHiddenPrototype, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, readOnlyPrototype, arginfo_function_template_readOnlyPrototype, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, removePrototype, arginfo_function_template_removePrototype, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, hasInstance, arginfo_function_template_hasInstance, ZEND_ACC_PUBLIC) - - PHP_ME(FunctionTemplate, adjustExternalAllocatedMemory, arginfo_function_template_adjustExternalAllocatedMemory, ZEND_ACC_PUBLIC) - PHP_ME(FunctionTemplate, getExternalAllocatedMemory, arginfo_function_template_getExternalAllocatedMemory, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(FunctionTemplate, getIsolate, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, set, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, setAccessorProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, setNativeDataProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, getFunction, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, setCallHandler, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, setLength, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, instanceTemplate, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, inherit, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, prototypeTemplate, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, setClassName, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, setAcceptAnyReceiver, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, setHiddenPrototype, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, readOnlyPrototype, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, removePrototype, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, hasInstance, ZEND_ACC_PUBLIC) + + PHP_V8_ME(FunctionTemplate, adjustExternalAllocatedMemory, ZEND_ACC_PUBLIC) + PHP_V8_ME(FunctionTemplate, getExternalAllocatedMemory, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_heap_statistics.cc b/src/php_v8_heap_statistics.cc index 8147344..f4046f1 100644 --- a/src/php_v8_heap_statistics.cc +++ b/src/php_v8_heap_statistics.cc @@ -161,7 +161,7 @@ static PHP_METHOD(HeapStatistics, does_zap_garbage) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_heap_statistics___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_ARG_TYPE_INFO(0, total_heap_size, IS_DOUBLE, 0) ZEND_ARG_TYPE_INFO(0, total_heap_size_executable, IS_DOUBLE, 0) ZEND_ARG_TYPE_INFO(0, total_physical_size, IS_DOUBLE, 0) @@ -175,46 +175,46 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_heap_statistics___construct, ZEND_SEND_BY_VAL, ZE ZEND_ARG_TYPE_INFO(0, does_zap_garbage, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__total_heap_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_total_heap_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__total_heap_size_executable, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_total_heap_size_executable, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__total_physical_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_total_physical_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__total_available_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_total_available_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__used_heap_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_used_heap_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__heap_size_limit, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_size_limit, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__malloced_memory, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_malloced_memory, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__peak_malloced_memory, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_peak_malloced_memory, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_heap_statistics__does_zap_garbage, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_does_zap_garbage, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_heap_statistics_methods[] = { - PHP_ME(HeapStatistics, __construct, arginfo_heap_statistics___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(HeapStatistics, total_heap_size, arginfo_heap_statistics__total_heap_size, ZEND_ACC_PUBLIC) - PHP_ME(HeapStatistics, total_heap_size_executable, arginfo_heap_statistics__total_heap_size_executable, ZEND_ACC_PUBLIC) - PHP_ME(HeapStatistics, total_physical_size, arginfo_heap_statistics__total_physical_size, ZEND_ACC_PUBLIC) - PHP_ME(HeapStatistics, total_available_size, arginfo_heap_statistics__total_available_size, ZEND_ACC_PUBLIC) - PHP_ME(HeapStatistics, used_heap_size, arginfo_heap_statistics__used_heap_size, ZEND_ACC_PUBLIC) - PHP_ME(HeapStatistics, heap_size_limit, arginfo_heap_statistics__heap_size_limit, ZEND_ACC_PUBLIC) - PHP_ME(HeapStatistics, malloced_memory, arginfo_heap_statistics__malloced_memory, ZEND_ACC_PUBLIC) - PHP_ME(HeapStatistics, peak_malloced_memory, arginfo_heap_statistics__peak_malloced_memory, ZEND_ACC_PUBLIC) - PHP_ME(HeapStatistics, does_zap_garbage, arginfo_heap_statistics__does_zap_garbage, ZEND_ACC_PUBLIC) + PHP_V8_ME(HeapStatistics, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + + PHP_V8_ME(HeapStatistics, total_heap_size, ZEND_ACC_PUBLIC) + PHP_V8_ME(HeapStatistics, total_heap_size_executable, ZEND_ACC_PUBLIC) + PHP_V8_ME(HeapStatistics, total_physical_size, ZEND_ACC_PUBLIC) + PHP_V8_ME(HeapStatistics, total_available_size, ZEND_ACC_PUBLIC) + PHP_V8_ME(HeapStatistics, used_heap_size, ZEND_ACC_PUBLIC) + PHP_V8_ME(HeapStatistics, heap_size_limit, ZEND_ACC_PUBLIC) + PHP_V8_ME(HeapStatistics, malloced_memory, ZEND_ACC_PUBLIC) + PHP_V8_ME(HeapStatistics, peak_malloced_memory, ZEND_ACC_PUBLIC) + PHP_V8_ME(HeapStatistics, does_zap_garbage, ZEND_ACC_PUBLIC) PHP_FE_END }; @@ -225,13 +225,13 @@ PHP_MINIT_FUNCTION (php_v8_heap_statistics) { INIT_NS_CLASS_ENTRY(ce, PHP_V8_NS, "HeapStatistics", php_v8_heap_statistics_methods); this_ce = zend_register_internal_class(&ce); - zend_declare_property_double(this_ce, ZEND_STRL("total_heap_size"), 0, ZEND_ACC_PRIVATE); + zend_declare_property_double(this_ce, ZEND_STRL("total_heap_size"), 0, ZEND_ACC_PRIVATE); zend_declare_property_double(this_ce, ZEND_STRL("total_heap_size_executable"), 0, ZEND_ACC_PRIVATE); - zend_declare_property_double(this_ce, ZEND_STRL("total_physical_size"), 0, ZEND_ACC_PRIVATE); + zend_declare_property_double(this_ce, ZEND_STRL("total_physical_size"), 0, ZEND_ACC_PRIVATE); zend_declare_property_double(this_ce, ZEND_STRL("total_available_size"), 0, ZEND_ACC_PRIVATE); - zend_declare_property_double(this_ce, ZEND_STRL("used_heap_size"), 0, ZEND_ACC_PRIVATE); - zend_declare_property_double(this_ce, ZEND_STRL("heap_size_limit"), 0, ZEND_ACC_PRIVATE); - zend_declare_property_double(this_ce, ZEND_STRL("malloced_memory"), 0, ZEND_ACC_PRIVATE); + zend_declare_property_double(this_ce, ZEND_STRL("used_heap_size"), 0, ZEND_ACC_PRIVATE); + zend_declare_property_double(this_ce, ZEND_STRL("heap_size_limit"), 0, ZEND_ACC_PRIVATE); + zend_declare_property_double(this_ce, ZEND_STRL("malloced_memory"), 0, ZEND_ACC_PRIVATE); zend_declare_property_double(this_ce, ZEND_STRL("peak_malloced_memory"), 0, ZEND_ACC_PRIVATE); zend_declare_property_bool(this_ce, ZEND_STRL("does_zap_garbage"), false, ZEND_ACC_PRIVATE); diff --git a/src/php_v8_indexed_property_handler_configuration.cc b/src/php_v8_indexed_property_handler_configuration.cc index 86116d5..db3a526 100644 --- a/src/php_v8_indexed_property_handler_configuration.cc +++ b/src/php_v8_indexed_property_handler_configuration.cc @@ -123,7 +123,7 @@ static PHP_METHOD(IndexedPropertyHandlerConfiguration, __construct) { } -ZEND_BEGIN_ARG_INFO_EX(php_v8_indexed_property_handler_configuration___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, getter) ZEND_ARG_INFO(0, setter) ZEND_ARG_INFO(0, query) @@ -134,7 +134,7 @@ ZEND_END_ARG_INFO() static const zend_function_entry php_v8_indexed_property_handler_configuration_methods[] = { - PHP_ME(IndexedPropertyHandlerConfiguration, __construct, php_v8_indexed_property_handler_configuration___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(IndexedPropertyHandlerConfiguration, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) PHP_FE_END }; diff --git a/src/php_v8_int32.cc b/src/php_v8_int32.cc index 451543b..a51675c 100644 --- a/src/php_v8_int32.cc +++ b/src/php_v8_int32.cc @@ -59,18 +59,19 @@ static PHP_METHOD(Int32, value) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_int32___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_int32_value, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_int32_methods[] = { - PHP_ME(Int32, __construct, arginfo_int32___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(Int32, value, arginfo_int32_value, ZEND_ACC_PUBLIC) + PHP_V8_ME(Int32, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Int32, value, ZEND_ACC_PUBLIC) + PHP_FE_END }; diff --git a/src/php_v8_integer.cc b/src/php_v8_integer.cc index a2be0f2..29009d5 100644 --- a/src/php_v8_integer.cc +++ b/src/php_v8_integer.cc @@ -64,18 +64,18 @@ static PHP_METHOD(Integer, value) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_integer___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_integer_value, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_integer_methods[] = { - PHP_ME(Integer, __construct, arginfo_integer___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(Integer, value, arginfo_integer_value, ZEND_ACC_PUBLIC) + PHP_V8_ME(Integer, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Integer, value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_isolate.cc b/src/php_v8_isolate.cc index 916a971..22784ae 100644 --- a/src/php_v8_isolate.cc +++ b/src/php_v8_isolate.cc @@ -487,104 +487,97 @@ static PHP_METHOD(Isolate, isInUse) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_ARG_OBJ_INFO(0, snapshot, V8\\StartupData, 1) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_setTimeLimit, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setTimeLimit, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, time_limit_in_seconds, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_getTimeLimit, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getTimeLimit, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_isTimeLimitHit, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isTimeLimitHit, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_setMemoryLimit, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setMemoryLimit, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, memory_limit_in_bytes, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_getMemoryLimit, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getMemoryLimit, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_isMemoryLimitHit, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isMemoryLimitHit, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_isolate_getHeapStatistics, ZEND_RETURN_VALUE, 0, V8\\HeapStatistics, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getHeapStatistics, ZEND_RETURN_VALUE, 0, V8\\HeapStatistics, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_inContext, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_inContext, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_isolate_getEnteredContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getEnteredContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_throwException, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_throwException, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, e, Throwable, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_idleNotificationDeadline, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_idleNotificationDeadline, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) ZEND_ARG_INFO(0, deadline_in_seconds) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_lowMemoryNotification, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_lowMemoryNotification, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_terminateExecution, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_terminateExecution, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_isExecutionTerminating, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isExecutionTerminating, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_cancelTerminateExecution, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_cancelTerminateExecution, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_isolate_setCaptureStackTraceForUncaughtExceptions, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setCaptureStackTraceForUncaughtExceptions, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, capture, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, frame_limit, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_isDead, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isDead, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isolate_isInUse, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isInUse, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_isolate_methods[] = { - PHP_ME(Isolate, __construct, arginfo_isolate___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(Isolate, setTimeLimit, arginfo_isolate_setTimeLimit, ZEND_ACC_PUBLIC) - PHP_ME(Isolate, getTimeLimit, arginfo_isolate_getTimeLimit, ZEND_ACC_PUBLIC) - PHP_ME(Isolate, isTimeLimitHit, arginfo_isolate_isTimeLimitHit, ZEND_ACC_PUBLIC) - - PHP_ME(Isolate, setMemoryLimit, arginfo_isolate_setMemoryLimit, ZEND_ACC_PUBLIC) - PHP_ME(Isolate, getMemoryLimit, arginfo_isolate_getMemoryLimit, ZEND_ACC_PUBLIC) - PHP_ME(Isolate, isMemoryLimitHit, arginfo_isolate_isMemoryLimitHit, ZEND_ACC_PUBLIC) - - PHP_ME(Isolate, getHeapStatistics, arginfo_isolate_getHeapStatistics, ZEND_ACC_PUBLIC) - - PHP_ME(Isolate, inContext, arginfo_isolate_inContext, ZEND_ACC_PUBLIC) - PHP_ME(Isolate, getEnteredContext, arginfo_isolate_getEnteredContext, ZEND_ACC_PUBLIC) - - PHP_ME(Isolate, throwException, arginfo_isolate_throwException, ZEND_ACC_PUBLIC) - PHP_ME(Isolate, idleNotificationDeadline, arginfo_isolate_idleNotificationDeadline, ZEND_ACC_PUBLIC) - PHP_ME(Isolate, lowMemoryNotification, arginfo_isolate_lowMemoryNotification, ZEND_ACC_PUBLIC) - - PHP_ME(Isolate, terminateExecution, arginfo_isolate_terminateExecution, ZEND_ACC_PUBLIC) - PHP_ME(Isolate, isExecutionTerminating, arginfo_isolate_isExecutionTerminating, ZEND_ACC_PUBLIC) - PHP_ME(Isolate, cancelTerminateExecution, arginfo_isolate_cancelTerminateExecution, ZEND_ACC_PUBLIC) - - PHP_ME(Isolate, setCaptureStackTraceForUncaughtExceptions, arginfo_isolate_setCaptureStackTraceForUncaughtExceptions, ZEND_ACC_PUBLIC) - PHP_ME(Isolate, isDead, arginfo_isolate_isDead, ZEND_ACC_PUBLIC) - PHP_ME(Isolate, isInUse, arginfo_isolate_isInUse, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Isolate, setTimeLimit, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, getTimeLimit, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, isTimeLimitHit, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, setMemoryLimit, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, getMemoryLimit, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, isMemoryLimitHit, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, getHeapStatistics, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, inContext, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, getEnteredContext, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, throwException, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, idleNotificationDeadline, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, lowMemoryNotification, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, terminateExecution, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, isExecutionTerminating, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, cancelTerminateExecution, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, isDead, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, isInUse, ZEND_ACC_PUBLIC) + PHP_V8_ME(Isolate, setCaptureStackTraceForUncaughtExceptions, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_map.cc b/src/php_v8_map.cc index 3db6724..1cad50c 100644 --- a/src/php_v8_map.cc +++ b/src/php_v8_map.cc @@ -225,53 +225,50 @@ static PHP_METHOD(Map, asArray) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_map___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_map_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_map_clear, ZEND_RETURN_VALUE, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_clear, ZEND_RETURN_VALUE, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_map_get, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_get, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_map_set, ZEND_RETURN_VALUE, 3, V8\\MapObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_set, ZEND_RETURN_VALUE, 3, V8\\MapObject, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_map_has, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_has, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_map_delete, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_delete, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_map_asArray, ZEND_RETURN_VALUE, 0, V8\\ArrayObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_asArray, ZEND_RETURN_VALUE, 0, V8\\ArrayObject, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_map_methods[] = { - PHP_ME(Map, __construct, arginfo_map___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(Map, size, arginfo_map_size, ZEND_ACC_PUBLIC) - PHP_ME(Map, clear, arginfo_map_clear, ZEND_ACC_PUBLIC) - - PHP_ME(Map, get, arginfo_map_get, ZEND_ACC_PUBLIC) - PHP_ME(Map, set, arginfo_map_set, ZEND_ACC_PUBLIC) - PHP_ME(Map, has, arginfo_map_has, ZEND_ACC_PUBLIC) - PHP_ME(Map, delete, arginfo_map_delete, ZEND_ACC_PUBLIC) - - PHP_ME(Map, asArray, arginfo_map_asArray, ZEND_ACC_PUBLIC) + PHP_V8_ME(Map, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Map, size, ZEND_ACC_PUBLIC) + PHP_V8_ME(Map, clear, ZEND_ACC_PUBLIC) + PHP_V8_ME(Map, get, ZEND_ACC_PUBLIC) + PHP_V8_ME(Map, set, ZEND_ACC_PUBLIC) + PHP_V8_ME(Map, has, ZEND_ACC_PUBLIC) + PHP_V8_ME(Map, delete, ZEND_ACC_PUBLIC) + PHP_V8_ME(Map, asArray, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_message.cc b/src/php_v8_message.cc index db5f579..912150c 100644 --- a/src/php_v8_message.cc +++ b/src/php_v8_message.cc @@ -277,7 +277,7 @@ static PHP_METHOD(Message, isOpaque) RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("is_opaque"), 0, &rv), 1, 0); } -ZEND_BEGIN_ARG_INFO_EX(arginfo_message___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 5) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 5) ZEND_ARG_TYPE_INFO(0, message, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, source_line, IS_STRING, 0) ZEND_ARG_OBJ_INFO(0, script_origin, V8\\ScriptOrigin, 0) @@ -292,62 +292,57 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_message___construct, ZEND_SEND_BY_VAL, ZEND_RETUR ZEND_ARG_TYPE_INFO(0, is_opaque, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_get, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_get, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getSourceLine, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getSourceLine, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_message_getScriptOrigin, ZEND_RETURN_VALUE, 0, V8\\ScriptOrigin, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getScriptOrigin, ZEND_RETURN_VALUE, 0, V8\\ScriptOrigin, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getScriptResourceName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getScriptResourceName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_message_getStackTrace, ZEND_RETURN_VALUE, 0, V8\\StackTrace, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getStackTrace, ZEND_RETURN_VALUE, 0, V8\\StackTrace, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getLineNumber, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getLineNumber, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getStartPosition, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getStartPosition, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getEndPosition, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getEndPosition, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getStartColumn, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getStartColumn, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_getEndColumn, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getEndColumn, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_isSharedCrossOrigin, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isSharedCrossOrigin, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_message_isOpaque, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isOpaque, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_message_methods[] = { - PHP_ME(Message, __construct, arginfo_message___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(Message, get, arginfo_message_get, ZEND_ACC_PUBLIC) - PHP_ME(Message, getSourceLine, arginfo_message_getSourceLine, ZEND_ACC_PUBLIC) - PHP_ME(Message, getScriptOrigin, arginfo_message_getScriptOrigin, ZEND_ACC_PUBLIC) - PHP_ME(Message, getScriptResourceName, arginfo_message_getScriptResourceName, ZEND_ACC_PUBLIC) - - PHP_ME(Message, getStackTrace, arginfo_message_getStackTrace, ZEND_ACC_PUBLIC) - - PHP_ME(Message, getLineNumber, arginfo_message_getLineNumber, ZEND_ACC_PUBLIC) - PHP_ME(Message, getStartPosition, arginfo_message_getStartPosition, ZEND_ACC_PUBLIC) - PHP_ME(Message, getEndPosition, arginfo_message_getEndPosition, ZEND_ACC_PUBLIC) - - PHP_ME(Message, getStartColumn, arginfo_message_getStartColumn, ZEND_ACC_PUBLIC) - PHP_ME(Message, getEndColumn, arginfo_message_getEndColumn, ZEND_ACC_PUBLIC) - - PHP_ME(Message, isSharedCrossOrigin, arginfo_message_isSharedCrossOrigin, ZEND_ACC_PUBLIC) - PHP_ME(Message, isOpaque, arginfo_message_isOpaque, ZEND_ACC_PUBLIC) + PHP_V8_ME(Message, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Message, get, ZEND_ACC_PUBLIC) + PHP_V8_ME(Message, getSourceLine, ZEND_ACC_PUBLIC) + PHP_V8_ME(Message, getScriptOrigin, ZEND_ACC_PUBLIC) + PHP_V8_ME(Message, getScriptResourceName, ZEND_ACC_PUBLIC) + PHP_V8_ME(Message, getStackTrace, ZEND_ACC_PUBLIC) + PHP_V8_ME(Message, getLineNumber, ZEND_ACC_PUBLIC) + PHP_V8_ME(Message, getStartPosition, ZEND_ACC_PUBLIC) + PHP_V8_ME(Message, getEndPosition, ZEND_ACC_PUBLIC) + PHP_V8_ME(Message, getStartColumn, ZEND_ACC_PUBLIC) + PHP_V8_ME(Message, getEndColumn, ZEND_ACC_PUBLIC) + PHP_V8_ME(Message, isSharedCrossOrigin, ZEND_ACC_PUBLIC) + PHP_V8_ME(Message, isOpaque, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_name.cc b/src/php_v8_name.cc index dcf6f7a..a25b616 100644 --- a/src/php_v8_name.cc +++ b/src/php_v8_name.cc @@ -42,12 +42,12 @@ static PHP_METHOD(Name, getIdentityHash) } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_name_getIdentityHash, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getIdentityHash, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_name_methods[] = { - PHP_ME(Name, getIdentityHash, arginfo_name_getIdentityHash, ZEND_ACC_PUBLIC) + PHP_V8_ME(Name, getIdentityHash, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_named_property_handler_configuration.cc b/src/php_v8_named_property_handler_configuration.cc index eda74f4..bbf208d 100644 --- a/src/php_v8_named_property_handler_configuration.cc +++ b/src/php_v8_named_property_handler_configuration.cc @@ -123,7 +123,7 @@ static PHP_METHOD(NamedPropertyHandlerConfiguration, __construct) { } -ZEND_BEGIN_ARG_INFO_EX(php_v8_named_property_handler_configuration___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, getter) ZEND_ARG_INFO(0, setter) ZEND_ARG_INFO(0, query) @@ -134,7 +134,7 @@ ZEND_END_ARG_INFO() static const zend_function_entry php_v8_named_property_handler_configuration_methods[] = { - PHP_ME(NamedPropertyHandlerConfiguration, __construct, php_v8_named_property_handler_configuration___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(NamedPropertyHandlerConfiguration, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) PHP_FE_END }; diff --git a/src/php_v8_null.cc b/src/php_v8_null.cc index 8c79302..7e2c4de 100644 --- a/src/php_v8_null.cc +++ b/src/php_v8_null.cc @@ -43,16 +43,16 @@ static PHP_METHOD(NullValue, value) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_null___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_null_value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_null_methods[] = { - PHP_ME(NullValue, __construct, arginfo_null___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(NullValue, value, arginfo_null_value, ZEND_ACC_PUBLIC) + PHP_V8_ME(NullValue, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(NullValue, value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_number.cc b/src/php_v8_number.cc index 5023ffd..bc83036 100644 --- a/src/php_v8_number.cc +++ b/src/php_v8_number.cc @@ -56,19 +56,19 @@ static PHP_METHOD(Number, value) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_number___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_TYPE_INFO(0, value, IS_DOUBLE, 0) ZEND_END_ARG_INFO() // no strict typing while we'll inherit this class -ZEND_BEGIN_ARG_INFO_EX(arginfo_number_value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_number_methods[] = { - PHP_ME(Number, __construct, arginfo_number___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(Number, value, arginfo_number_value, ZEND_ACC_PUBLIC) + PHP_V8_ME(Number, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Number, value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_number_object.cc b/src/php_v8_number_object.cc index 0022a1e..b14d1ed 100644 --- a/src/php_v8_number_object.cc +++ b/src/php_v8_number_object.cc @@ -58,19 +58,18 @@ static PHP_METHOD(NumberObject, valueOf) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_number_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, value) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_number_object_valueOf, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_valueOf, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_number_object_methods[] = { - PHP_ME(NumberObject, __construct, arginfo_number_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(NumberObject, valueOf, arginfo_number_object_valueOf, ZEND_ACC_PUBLIC) + PHP_V8_ME(NumberObject, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(NumberObject, valueOf, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_object.cc b/src/php_v8_object.cc index 25f5f1b..f681d4d 100644 --- a/src/php_v8_object.cc +++ b/src/php_v8_object.cc @@ -1289,59 +1289,59 @@ static PHP_METHOD(Object, getExternalAllocatedMemory) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_object_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 3) +ZEND_BEGIN_ARG_INFO_EX(arginfo_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 3) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_createDataProperty, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_createDataProperty, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_defineOwnProperty, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_defineOwnProperty, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Value, 0) ZEND_ARG_INFO(0, attributes) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_get, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_get, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_getPropertyAttributes, ZEND_RETURN_VALUE, 2, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getPropertyAttributes, ZEND_RETURN_VALUE, 2, IS_LONG, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_getOwnPropertyDescriptor, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getOwnPropertyDescriptor, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_has, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_has, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_delete, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_delete, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() // bool -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_setAccessor, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_setAccessor, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_CALLABLE_INFO(0, getter, 0) @@ -1351,7 +1351,7 @@ PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_setAccessor, ZEND_ ZEND_END_ARG_INFO() //void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_setAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, getter, V8\\FunctionObject, 0) ZEND_ARG_OBJ_INFO(0, setter, V8\\FunctionObject, 0) @@ -1359,7 +1359,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_setAccessorProperty, ZEND_SEND_BY_V ZEND_ARG_TYPE_INFO(0, settings, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_object_setNativeDataProperty, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_setNativeDataProperty, ZEND_RETURN_VALUE, 3, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_CALLABLE_INFO(0, getter, 0) @@ -1367,167 +1367,166 @@ PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_object_setNativeDa ZEND_ARG_TYPE_INFO(0, attributes, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_getPropertyNames, ZEND_RETURN_VALUE, 1, V8\\ArrayObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getPropertyNames, ZEND_RETURN_VALUE, 1, V8\\ArrayObject, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_TYPE_INFO(0, mode, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, property_filter, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, index_filter, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_getOwnPropertyNames, ZEND_RETURN_VALUE, 1, V8\\ArrayObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getOwnPropertyNames, ZEND_RETURN_VALUE, 1, V8\\ArrayObject, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_TYPE_INFO(0, filter, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_getPrototype, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getPrototype, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_php_v8_object_setPrototype, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_setPrototype, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, prototype, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_findInstanceInPrototypeChain, ZEND_RETURN_VALUE, 1, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_findInstanceInPrototypeChain, ZEND_RETURN_VALUE, 1, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, tmpl, V8\\FunctionTemplate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_php_v8_object_objectProtoToString, ZEND_RETURN_VALUE, 1, V8\\StringValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_objectProtoToString, ZEND_RETURN_VALUE, 1, V8\\StringValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_getConstructorName, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getConstructorName, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_setIntegrityLevel, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_setIntegrityLevel, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_TYPE_INFO(0, level, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_hasOwnProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hasOwnProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_hasRealNamedProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hasRealNamedProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_hasRealIndexedProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hasRealIndexedProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, index) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_hasRealNamedCallbackProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hasRealNamedCallbackProperty, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_getRealNamedPropertyInPrototypeChain, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getRealNamedPropertyInPrototypeChain, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_getRealNamedPropertyAttributesInPrototypeChain, ZEND_RETURN_VALUE, 2, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getRealNamedPropertyAttributesInPrototypeChain, ZEND_RETURN_VALUE, 2, IS_LONG, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_getRealNamedProperty, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getRealNamedProperty, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_getRealNamedPropertyAttributes, ZEND_RETURN_VALUE, 2, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getRealNamedPropertyAttributes, ZEND_RETURN_VALUE, 2, IS_LONG, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_hasNamedLookupInterceptor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hasNamedLookupInterceptor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_hasIndexedLookupInterceptor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hasIndexedLookupInterceptor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_getIdentityHash, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getIdentityHash, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_clone, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_clone, ZEND_RETURN_VALUE, 0, V8\\ObjectValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_isCallable, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isCallable, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_isConstructor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isConstructor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_callAsFunction, ZEND_RETURN_VALUE, 2, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_callAsFunction, ZEND_RETURN_VALUE, 2, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, recv, V8\\Value, 0) ZEND_ARG_ARRAY_INFO(0, arguments, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_callAsConstructor, ZEND_RETURN_VALUE, 1, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_callAsConstructor, ZEND_RETURN_VALUE, 1, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_ARRAY_INFO(0, arguments, 0) ZEND_END_ARG_INFO() // static methods -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_adjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_adjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, change_in_bytes, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_getExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_object_methods[] = { - PHP_ME(Object, __construct, arginfo_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(Object, getContext, arginfo_object_getContext, ZEND_ACC_PUBLIC) - PHP_ME(Object, set, arginfo_object_set, ZEND_ACC_PUBLIC) - PHP_ME(Object, createDataProperty, arginfo_object_createDataProperty, ZEND_ACC_PUBLIC) - PHP_ME(Object, defineOwnProperty, arginfo_object_defineOwnProperty, ZEND_ACC_PUBLIC) - PHP_ME(Object, get, arginfo_object_get, ZEND_ACC_PUBLIC) - PHP_ME(Object, getPropertyAttributes, arginfo_object_getPropertyAttributes, ZEND_ACC_PUBLIC) - PHP_ME(Object, getOwnPropertyDescriptor, arginfo_object_getOwnPropertyDescriptor, ZEND_ACC_PUBLIC) - PHP_ME(Object, has, arginfo_object_has, ZEND_ACC_PUBLIC) - PHP_ME(Object, delete, arginfo_object_delete, ZEND_ACC_PUBLIC) - PHP_ME(Object, setAccessor, arginfo_object_setAccessor, ZEND_ACC_PUBLIC) - PHP_ME(Object, setAccessorProperty, arginfo_php_v8_object_setAccessorProperty, ZEND_ACC_PUBLIC) - PHP_ME(Object, setNativeDataProperty, arginfo_php_v8_object_setNativeDataProperty, ZEND_ACC_PUBLIC) - PHP_ME(Object, getPropertyNames, arginfo_php_v8_object_getPropertyNames, ZEND_ACC_PUBLIC) - PHP_ME(Object, getOwnPropertyNames, arginfo_php_v8_object_getOwnPropertyNames, ZEND_ACC_PUBLIC) - PHP_ME(Object, getPrototype, arginfo_php_v8_object_getPrototype, ZEND_ACC_PUBLIC) - PHP_ME(Object, setPrototype, arginfo_php_v8_object_setPrototype, ZEND_ACC_PUBLIC) - PHP_ME(Object, findInstanceInPrototypeChain, arginfo_php_v8_object_findInstanceInPrototypeChain, ZEND_ACC_PUBLIC) - PHP_ME(Object, objectProtoToString, arginfo_php_v8_object_objectProtoToString, ZEND_ACC_PUBLIC) - PHP_ME(Object, getConstructorName, arginfo_object_getConstructorName, ZEND_ACC_PUBLIC) - PHP_ME(Object, setIntegrityLevel, arginfo_object_setIntegrityLevel, ZEND_ACC_PUBLIC) - - PHP_ME(Object, hasOwnProperty, arginfo_object_hasOwnProperty, ZEND_ACC_PUBLIC) - PHP_ME(Object, hasRealNamedProperty, arginfo_object_hasRealNamedProperty, ZEND_ACC_PUBLIC) - PHP_ME(Object, hasRealIndexedProperty, arginfo_object_hasRealIndexedProperty, ZEND_ACC_PUBLIC) - PHP_ME(Object, hasRealNamedCallbackProperty, arginfo_object_hasRealNamedCallbackProperty, ZEND_ACC_PUBLIC) - - PHP_ME(Object, getRealNamedPropertyInPrototypeChain, arginfo_object_getRealNamedPropertyInPrototypeChain, ZEND_ACC_PUBLIC) - PHP_ME(Object, getRealNamedPropertyAttributesInPrototypeChain, arginfo_object_getRealNamedPropertyAttributesInPrototypeChain, ZEND_ACC_PUBLIC) - PHP_ME(Object, getRealNamedProperty, arginfo_object_getRealNamedProperty, ZEND_ACC_PUBLIC) - PHP_ME(Object, getRealNamedPropertyAttributes, arginfo_object_getRealNamedPropertyAttributes, ZEND_ACC_PUBLIC) - - PHP_ME(Object, hasNamedLookupInterceptor, arginfo_object_hasNamedLookupInterceptor, ZEND_ACC_PUBLIC) - PHP_ME(Object, hasIndexedLookupInterceptor, arginfo_object_hasIndexedLookupInterceptor, ZEND_ACC_PUBLIC) - PHP_ME(Object, getIdentityHash, arginfo_object_getIdentityHash, ZEND_ACC_PUBLIC) - PHP_ME(Object, clone, arginfo_object_clone, ZEND_ACC_PUBLIC) - - PHP_ME(Object, isCallable, arginfo_object_isCallable, ZEND_ACC_PUBLIC) - PHP_ME(Object, isConstructor, arginfo_object_isConstructor, ZEND_ACC_PUBLIC) - PHP_ME(Object, callAsFunction, arginfo_object_callAsFunction, ZEND_ACC_PUBLIC) - PHP_ME(Object, callAsConstructor, arginfo_object_callAsConstructor, ZEND_ACC_PUBLIC) - - PHP_ME(Object, adjustExternalAllocatedMemory, arginfo_object_adjustExternalAllocatedMemory, ZEND_ACC_PUBLIC) - PHP_ME(Object, getExternalAllocatedMemory, arginfo_object_getExternalAllocatedMemory, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Object, getContext, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, set, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, createDataProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, defineOwnProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, get, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, getPropertyAttributes, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, getOwnPropertyDescriptor, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, has, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, delete, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, setAccessor, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, setAccessorProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, setNativeDataProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, getPropertyNames, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, getOwnPropertyNames, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, getPrototype, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, setPrototype, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, findInstanceInPrototypeChain, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, objectProtoToString, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, getConstructorName, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, setIntegrityLevel, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, hasOwnProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, hasRealNamedProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, hasRealIndexedProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, hasRealNamedCallbackProperty, ZEND_ACC_PUBLIC) + + PHP_V8_ME(Object, getRealNamedPropertyInPrototypeChain, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, getRealNamedPropertyAttributesInPrototypeChain, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, getRealNamedProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, getRealNamedPropertyAttributes, ZEND_ACC_PUBLIC) + + PHP_V8_ME(Object, hasNamedLookupInterceptor, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, hasIndexedLookupInterceptor, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, getIdentityHash, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, clone, ZEND_ACC_PUBLIC) + + PHP_V8_ME(Object, isCallable, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, isConstructor, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, callAsFunction, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, callAsConstructor, ZEND_ACC_PUBLIC) + + PHP_V8_ME(Object, adjustExternalAllocatedMemory, ZEND_ACC_PUBLIC) + PHP_V8_ME(Object, getExternalAllocatedMemory, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_object_template.cc b/src/php_v8_object_template.cc index 9b8af2a..ba55886 100644 --- a/src/php_v8_object_template.cc +++ b/src/php_v8_object_template.cc @@ -383,23 +383,23 @@ static PHP_METHOD(ObjectTemplate, getExternalAllocatedMemory) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_object_template___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_OBJ_INFO(0, constructor, V8\\FunctionTemplate, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_template_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Data, 0) ZEND_ARG_TYPE_INFO(0, attributes, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, getter, V8\\FunctionTemplate, 0) ZEND_ARG_OBJ_INFO(0, setter, V8\\FunctionTemplate, 0) @@ -408,7 +408,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setAccessorProperty, ZEND_ ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setNativeDataProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setNativeDataProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_CALLABLE_INFO(0, getter, 0) ZEND_ARG_CALLABLE_INFO(0, setter, 1) @@ -419,12 +419,12 @@ ZEND_END_ARG_INFO() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_object_template_newInstance, ZEND_RETURN_VALUE, 1, V8\\ObjectValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_newInstance, ZEND_RETURN_VALUE, 1, V8\\ObjectValue, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Context, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setAccessor, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setAccessor, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_CALLABLE_INFO(0, getter, 0) ZEND_ARG_CALLABLE_INFO(0, setter, 1) @@ -434,47 +434,42 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setAccessor, ZEND_SEND_BY_ ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setHandlerForNamedProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setHandlerForNamedProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, configuration, V8\\NamedPropertyHandlerConfiguration, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setHandlerForIndexedProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setHandlerForIndexedProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, configuration, V8\\IndexedPropertyHandlerConfiguration, 0) ZEND_END_ARG_INFO() // void method -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_object_template_setCallAsFunctionHandler, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setCallAsFunctionHandler, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_INFO(0, callback) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_template_adjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_adjustExternalAllocatedMemory, ZEND_RETURN_VALUE, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, change_in_bytes, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_object_template_getExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getExternalAllocatedMemory, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_object_template_methods[] = { - PHP_ME(ObjectTemplate, __construct, arginfo_object_template___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(ObjectTemplate, getIsolate, arginfo_object_template_getIsolate, ZEND_ACC_PUBLIC) - - PHP_ME(ObjectTemplate, set, arginfo_php_v8_object_template_set, ZEND_ACC_PUBLIC) - PHP_ME(ObjectTemplate, setAccessorProperty, arginfo_php_v8_object_template_setAccessorProperty, ZEND_ACC_PUBLIC) - PHP_ME(ObjectTemplate, setNativeDataProperty, arginfo_php_v8_object_template_setNativeDataProperty, ZEND_ACC_PUBLIC) - - - PHP_ME(ObjectTemplate, newInstance, arginfo_object_template_newInstance, ZEND_ACC_PUBLIC) - PHP_ME(ObjectTemplate, setAccessor, arginfo_php_v8_object_template_setAccessor, ZEND_ACC_PUBLIC) - PHP_ME(ObjectTemplate, setHandlerForNamedProperty, arginfo_php_v8_object_template_setHandlerForNamedProperty, ZEND_ACC_PUBLIC) - PHP_ME(ObjectTemplate, setHandlerForIndexedProperty, arginfo_php_v8_object_template_setHandlerForIndexedProperty, ZEND_ACC_PUBLIC) - PHP_ME(ObjectTemplate, setCallAsFunctionHandler, arginfo_php_v8_object_template_setCallAsFunctionHandler, ZEND_ACC_PUBLIC) - - PHP_ME(ObjectTemplate, adjustExternalAllocatedMemory, arginfo_object_template_adjustExternalAllocatedMemory, ZEND_ACC_PUBLIC) - PHP_ME(ObjectTemplate, getExternalAllocatedMemory, arginfo_object_template_getExternalAllocatedMemory, ZEND_ACC_PUBLIC) + PHP_V8_ME(ObjectTemplate, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(ObjectTemplate, getIsolate, ZEND_ACC_PUBLIC) + PHP_V8_ME(ObjectTemplate, set, ZEND_ACC_PUBLIC) + PHP_V8_ME(ObjectTemplate, setAccessorProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(ObjectTemplate, setNativeDataProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(ObjectTemplate, newInstance, ZEND_ACC_PUBLIC) + PHP_V8_ME(ObjectTemplate, setAccessor, ZEND_ACC_PUBLIC) + PHP_V8_ME(ObjectTemplate, setHandlerForNamedProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(ObjectTemplate, setHandlerForIndexedProperty, ZEND_ACC_PUBLIC) + PHP_V8_ME(ObjectTemplate, setCallAsFunctionHandler, ZEND_ACC_PUBLIC) + PHP_V8_ME(ObjectTemplate, adjustExternalAllocatedMemory, ZEND_ACC_PUBLIC) + PHP_V8_ME(ObjectTemplate, getExternalAllocatedMemory, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_property_callback_info.cc b/src/php_v8_property_callback_info.cc index 692a8a1..cffd664 100644 --- a/src/php_v8_property_callback_info.cc +++ b/src/php_v8_property_callback_info.cc @@ -105,11 +105,11 @@ static PHP_METHOD(PropertyCallbackInfo, shouldThrowOnError) { ZVAL_COPY(return_value, tmp); } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_property_callback_info_shouldThrowOnError, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_shouldThrowOnError, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_property_callback_info_methods[] = { - PHP_ME(PropertyCallbackInfo, shouldThrowOnError, arginfo_property_callback_info_shouldThrowOnError, ZEND_ACC_PUBLIC) + PHP_V8_ME(PropertyCallbackInfo, shouldThrowOnError, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_regexp.cc b/src/php_v8_regexp.cc index 68e94bc..5d23a6a 100644 --- a/src/php_v8_regexp.cc +++ b/src/php_v8_regexp.cc @@ -82,24 +82,23 @@ static PHP_METHOD(RegExp, getFlags) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_regexp___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\StringValue, 0) ZEND_ARG_TYPE_INFO(0, flags, IS_LONG, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_regexp_getSource, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getSource, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_regexp_getFlags, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getFlags, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_regexp_methods[] = { - PHP_ME(RegExp, __construct, arginfo_regexp___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(RegExp, getSource, arginfo_regexp_getSource, ZEND_ACC_PUBLIC) - PHP_ME(RegExp, getFlags, arginfo_regexp_getFlags, ZEND_ACC_PUBLIC) + PHP_V8_ME(RegExp, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(RegExp, getSource, ZEND_ACC_PUBLIC) + PHP_V8_ME(RegExp, getFlags, ZEND_ACC_PUBLIC) PHP_FE_END }; @@ -117,12 +116,12 @@ PHP_MINIT_FUNCTION(php_v8_regexp) { INIT_NS_CLASS_ENTRY(ce, "V8\\RegExpObject", "Flags", php_v8_regexp_flags_methods); php_v8_regexp_flags_class_entry = zend_register_internal_class(&ce); - zend_declare_class_constant_long(php_v8_regexp_flags_class_entry, ZEND_STRL("kNone"), v8::RegExp::Flags::kNone); - zend_declare_class_constant_long(php_v8_regexp_flags_class_entry, ZEND_STRL("kGlobal"), v8::RegExp::Flags::kGlobal); + zend_declare_class_constant_long(php_v8_regexp_flags_class_entry, ZEND_STRL("kNone"), v8::RegExp::Flags::kNone); + zend_declare_class_constant_long(php_v8_regexp_flags_class_entry, ZEND_STRL("kGlobal"), v8::RegExp::Flags::kGlobal); zend_declare_class_constant_long(php_v8_regexp_flags_class_entry, ZEND_STRL("kIgnoreCase"), v8::RegExp::Flags::kIgnoreCase); - zend_declare_class_constant_long(php_v8_regexp_flags_class_entry, ZEND_STRL("kMultiline"), v8::RegExp::Flags::kMultiline); - zend_declare_class_constant_long(php_v8_regexp_flags_class_entry, ZEND_STRL("kSticky"), v8::RegExp::Flags::kSticky); - zend_declare_class_constant_long(php_v8_regexp_flags_class_entry, ZEND_STRL("kUnicode"), v8::RegExp::Flags::kUnicode); + zend_declare_class_constant_long(php_v8_regexp_flags_class_entry, ZEND_STRL("kMultiline"), v8::RegExp::Flags::kMultiline); + zend_declare_class_constant_long(php_v8_regexp_flags_class_entry, ZEND_STRL("kSticky"), v8::RegExp::Flags::kSticky); + zend_declare_class_constant_long(php_v8_regexp_flags_class_entry, ZEND_STRL("kUnicode"), v8::RegExp::Flags::kUnicode); return SUCCESS; } diff --git a/src/php_v8_return_value.cc b/src/php_v8_return_value.cc index 32bca2f..3a3ebd1 100644 --- a/src/php_v8_return_value.cc +++ b/src/php_v8_return_value.cc @@ -355,55 +355,56 @@ static PHP_METHOD(ReturnValue, inContext) { RETURN_BOOL(PHP_V8_RETURN_VALUE_IN_CONTEXT(php_v8_return_value)); } +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_get, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, value, V8\\Value, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_setNull, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setNull, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_setUndefined, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setUndefined, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_setEmptyString, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setEmptyString, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_setBool, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setBool, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, value, _IS_BOOL, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_setInteger, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setInteger, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, i, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_return_value_setFloat, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setFloat, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, i, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_return_value_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_return_value_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_return_value_inContext, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_inContext, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_return_value_methods[] = { - PHP_ME(ReturnValue, get, arginfo_return_value_set, ZEND_ACC_PUBLIC) - PHP_ME(ReturnValue, set, arginfo_return_value_set, ZEND_ACC_PUBLIC) - PHP_ME(ReturnValue, setNull, arginfo_return_value_setNull, ZEND_ACC_PUBLIC) - PHP_ME(ReturnValue, setUndefined, arginfo_return_value_setUndefined, ZEND_ACC_PUBLIC) - PHP_ME(ReturnValue, setEmptyString, arginfo_return_value_setEmptyString, ZEND_ACC_PUBLIC) - PHP_ME(ReturnValue, setBool, arginfo_return_value_setBool, ZEND_ACC_PUBLIC) - PHP_ME(ReturnValue, setInteger, arginfo_return_value_setInteger, ZEND_ACC_PUBLIC) - PHP_ME(ReturnValue, setFloat, arginfo_return_value_setFloat, ZEND_ACC_PUBLIC) - - PHP_ME(ReturnValue, getIsolate, arginfo_return_value_getIsolate, ZEND_ACC_PUBLIC) - PHP_ME(ReturnValue, getContext, arginfo_return_value_getContext, ZEND_ACC_PUBLIC) - PHP_ME(ReturnValue, inContext, arginfo_return_value_inContext, ZEND_ACC_PUBLIC) + PHP_V8_ME(ReturnValue, get, ZEND_ACC_PUBLIC) + PHP_V8_ME(ReturnValue, set, ZEND_ACC_PUBLIC) + PHP_V8_ME(ReturnValue, setNull, ZEND_ACC_PUBLIC) + PHP_V8_ME(ReturnValue, setUndefined, ZEND_ACC_PUBLIC) + PHP_V8_ME(ReturnValue, setEmptyString, ZEND_ACC_PUBLIC) + PHP_V8_ME(ReturnValue, setBool, ZEND_ACC_PUBLIC) + PHP_V8_ME(ReturnValue, setInteger, ZEND_ACC_PUBLIC) + PHP_V8_ME(ReturnValue, setFloat, ZEND_ACC_PUBLIC) + PHP_V8_ME(ReturnValue, getIsolate, ZEND_ACC_PUBLIC) + PHP_V8_ME(ReturnValue, getContext, ZEND_ACC_PUBLIC) + PHP_V8_ME(ReturnValue, inContext, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_script.cc b/src/php_v8_script.cc index df09800..b0b5722 100644 --- a/src/php_v8_script.cc +++ b/src/php_v8_script.cc @@ -203,33 +203,32 @@ static PHP_METHOD(Script, getUnboundScript) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_script___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, source, V8\\StringValue, 0) ZEND_ARG_OBJ_INFO(0, origin, V8\\ScriptOrigin, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_run, ZEND_RETURN_VALUE, 1, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_run, ZEND_RETURN_VALUE, 1, V8\\Value, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_getUnboundScript, ZEND_RETURN_VALUE, 0, V8\\UnboundScript, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getUnboundScript, ZEND_RETURN_VALUE, 0, V8\\UnboundScript, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_script_methods[] = { - PHP_ME(Script, __construct, arginfo_script___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(Script, getIsolate, arginfo_script_getIsolate, ZEND_ACC_PUBLIC) - PHP_ME(Script, getContext, arginfo_script_getContext, ZEND_ACC_PUBLIC) - - PHP_ME(Script, run, arginfo_script_run, ZEND_ACC_PUBLIC) - PHP_ME(Script, getUnboundScript, arginfo_script_getUnboundScript, ZEND_ACC_PUBLIC) + PHP_V8_ME(Script, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Script, getIsolate, ZEND_ACC_PUBLIC) + PHP_V8_ME(Script, getContext, ZEND_ACC_PUBLIC) + PHP_V8_ME(Script, run, ZEND_ACC_PUBLIC) + PHP_V8_ME(Script, getUnboundScript, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_script_compiler.cc b/src/php_v8_script_compiler.cc index 0d90f18..7b83e10 100644 --- a/src/php_v8_script_compiler.cc +++ b/src/php_v8_script_compiler.cc @@ -253,22 +253,22 @@ static PHP_METHOD(ScriptCompiler, compileFunctionInContext) } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_compiler_cachedDataVersionTag, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_cachedDataVersionTag, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_compiler_compileUnboundScript, ZEND_RETURN_VALUE, 2, V8\\UnboundScript, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_compileUnboundScript, ZEND_RETURN_VALUE, 2, V8\\UnboundScript, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, source, V8\\ScriptCompiler\\Source, 0) ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_compiler_compile, ZEND_RETURN_VALUE, 2, V8\\Script, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_compile, ZEND_RETURN_VALUE, 2, V8\\Script, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, source, V8\\ScriptCompiler\\Source, 0) ZEND_ARG_TYPE_INFO(0, options, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_compiler_compileFunctionInContext, ZEND_RETURN_VALUE, 2, V8\\FunctionObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_compileFunctionInContext, ZEND_RETURN_VALUE, 2, V8\\FunctionObject, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, source, V8\\ScriptCompiler\\Source, 0) ZEND_ARG_TYPE_INFO(0, arguments, IS_ARRAY, 0) @@ -277,10 +277,10 @@ ZEND_END_ARG_INFO() static const zend_function_entry php_v8_script_compiler_methods[] = { - PHP_ME(ScriptCompiler, cachedDataVersionTag, arginfo_script_compiler_cachedDataVersionTag, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(ScriptCompiler, compileUnboundScript, arginfo_script_compiler_compileUnboundScript, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(ScriptCompiler, compile, arginfo_script_compiler_compile, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(ScriptCompiler, compileFunctionInContext, arginfo_script_compiler_compileFunctionInContext, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(ScriptCompiler, cachedDataVersionTag, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(ScriptCompiler, compileUnboundScript, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(ScriptCompiler, compile, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(ScriptCompiler, compileFunctionInContext, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/src/php_v8_script_origin.cc b/src/php_v8_script_origin.cc index 4fc6730..aa9aec0 100644 --- a/src/php_v8_script_origin.cc +++ b/src/php_v8_script_origin.cc @@ -255,7 +255,7 @@ static PHP_METHOD(ScriptOrigin, options) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_script_origin___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, resource_name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, resource_line_offset, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, resource_column_offset, IS_LONG, 0) @@ -265,34 +265,33 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_script_origin___construct, ZEND_SEND_BY_VAL, ZEND ZEND_ARG_TYPE_INFO(0, resource_is_opaque, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_resourceName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_resourceName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_resourceLineOffset, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_resourceLineOffset, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_resourceColumnOffset, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_resourceColumnOffset, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_scriptID, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_scriptID, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_sourceMapUrl, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sourceMapUrl, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_script_origin_options, ZEND_RETURN_VALUE, 0, V8\\ScriptOriginOptions, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_options, ZEND_RETURN_VALUE, 0, V8\\ScriptOriginOptions, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_script_origin_methods[] = { - PHP_ME(ScriptOrigin, __construct, arginfo_script_origin___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(ScriptOrigin, resourceName, arginfo_script_origin_resourceName, ZEND_ACC_PUBLIC) - PHP_ME(ScriptOrigin, resourceLineOffset, arginfo_script_origin_resourceLineOffset, ZEND_ACC_PUBLIC) - PHP_ME(ScriptOrigin, resourceColumnOffset, arginfo_script_origin_resourceColumnOffset, ZEND_ACC_PUBLIC) - PHP_ME(ScriptOrigin, scriptID, arginfo_script_origin_scriptID, ZEND_ACC_PUBLIC) - PHP_ME(ScriptOrigin, sourceMapUrl, arginfo_script_origin_sourceMapUrl, ZEND_ACC_PUBLIC) - PHP_ME(ScriptOrigin, options, arginfo_script_origin_options, ZEND_ACC_PUBLIC) + PHP_V8_ME(ScriptOrigin, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(ScriptOrigin, resourceName, ZEND_ACC_PUBLIC) + PHP_V8_ME(ScriptOrigin, resourceLineOffset, ZEND_ACC_PUBLIC) + PHP_V8_ME(ScriptOrigin, resourceColumnOffset, ZEND_ACC_PUBLIC) + PHP_V8_ME(ScriptOrigin, scriptID, ZEND_ACC_PUBLIC) + PHP_V8_ME(ScriptOrigin, sourceMapUrl, ZEND_ACC_PUBLIC) + PHP_V8_ME(ScriptOrigin, options, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_script_origin_options.cc b/src/php_v8_script_origin_options.cc index 844b95c..2cc462d 100644 --- a/src/php_v8_script_origin_options.cc +++ b/src/php_v8_script_origin_options.cc @@ -88,7 +88,7 @@ static PHP_METHOD(ScriptOriginOptions, isModule) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_script_origin_options___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_ARG_TYPE_INFO(0, is_shared_cross_origin, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, is_opaque, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, is_wasm, _IS_BOOL, 0) @@ -96,26 +96,25 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_script_origin_options___construct, ZEND_SEND_BY_V ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_options_isSharedCrossOrigin, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isSharedCrossOrigin, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_options_isOpaque, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isOpaque, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_options_isWasm, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isWasm, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_script_origin_options_isModule, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isModule, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_script_origin_options_methods[] = { - PHP_ME(ScriptOriginOptions, __construct, arginfo_script_origin_options___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(ScriptOriginOptions, isSharedCrossOrigin, arginfo_script_origin_options_isSharedCrossOrigin, ZEND_ACC_PUBLIC) - PHP_ME(ScriptOriginOptions, isOpaque, arginfo_script_origin_options_isOpaque, ZEND_ACC_PUBLIC) - PHP_ME(ScriptOriginOptions, isWasm, arginfo_script_origin_options_isWasm, ZEND_ACC_PUBLIC) - PHP_ME(ScriptOriginOptions, isModule, arginfo_script_origin_options_isModule, ZEND_ACC_PUBLIC) + PHP_V8_ME(ScriptOriginOptions, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(ScriptOriginOptions, isSharedCrossOrigin, ZEND_ACC_PUBLIC) + PHP_V8_ME(ScriptOriginOptions, isOpaque, ZEND_ACC_PUBLIC) + PHP_V8_ME(ScriptOriginOptions, isWasm, ZEND_ACC_PUBLIC) + PHP_V8_ME(ScriptOriginOptions, isModule, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_set.cc b/src/php_v8_set.cc index dc469a8..5e7111c 100644 --- a/src/php_v8_set.cc +++ b/src/php_v8_set.cc @@ -184,46 +184,43 @@ static PHP_METHOD(Set, asArray) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_set___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_size, ZEND_RETURN_VALUE, 0, IS_DOUBLE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_set_clear, ZEND_RETURN_VALUE, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_clear, ZEND_RETURN_VALUE, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_set_add, ZEND_RETURN_VALUE, 3, V8\\SetObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_add, ZEND_RETURN_VALUE, 3, V8\\SetObject, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_has, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_has, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_delete, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_delete, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, key, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_set_asArray, ZEND_RETURN_VALUE, 0, V8\\ArrayObject, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_asArray, ZEND_RETURN_VALUE, 0, V8\\ArrayObject, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_set_methods[] = { - PHP_ME(Set, __construct, arginfo_set___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(Set, size, arginfo_set_size, ZEND_ACC_PUBLIC) - PHP_ME(Set, clear, arginfo_set_clear, ZEND_ACC_PUBLIC) - - PHP_ME(Set, add, arginfo_set_add, ZEND_ACC_PUBLIC) - PHP_ME(Set, has, arginfo_set_has, ZEND_ACC_PUBLIC) - PHP_ME(Set, delete, arginfo_set_delete, ZEND_ACC_PUBLIC) - - PHP_ME(Set, asArray, arginfo_set_asArray, ZEND_ACC_PUBLIC) + PHP_V8_ME(Set, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Set, size, ZEND_ACC_PUBLIC) + PHP_V8_ME(Set, clear, ZEND_ACC_PUBLIC) + PHP_V8_ME(Set, add, ZEND_ACC_PUBLIC) + PHP_V8_ME(Set, has, ZEND_ACC_PUBLIC) + PHP_V8_ME(Set, delete, ZEND_ACC_PUBLIC) + PHP_V8_ME(Set, asArray, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_source.cc b/src/php_v8_source.cc index 6b8044e..5ee35de 100644 --- a/src/php_v8_source.cc +++ b/src/php_v8_source.cc @@ -99,27 +99,27 @@ static PHP_METHOD(Source, getCachedData) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_source___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, source_string, V8\\StringValue, 0) ZEND_ARG_OBJ_INFO(0, origin, V8\\ScriptOrigin, 1) ZEND_ARG_OBJ_INFO(0, cached_data, V8\\ScriptCompiler\\CachedData, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_source_getSourceString, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getSourceString, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_source_getScriptOrigin, ZEND_RETURN_VALUE, 0, V8\\ScriptOrigin, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getScriptOrigin, ZEND_RETURN_VALUE, 0, V8\\ScriptOrigin, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_source_getCachedData, ZEND_RETURN_VALUE, 0, V8\\ScriptCompiler\\CachedData, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getCachedData, ZEND_RETURN_VALUE, 0, V8\\ScriptCompiler\\CachedData, 1) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_source_methods[] = { - PHP_ME(Source, __construct, arginfo_source___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(Source, getSourceString, arginfo_source_getSourceString, ZEND_ACC_PUBLIC) - PHP_ME(Source, getScriptOrigin, arginfo_source_getScriptOrigin, ZEND_ACC_PUBLIC) - PHP_ME(Source, getCachedData, arginfo_source_getCachedData, ZEND_ACC_PUBLIC) + PHP_V8_ME(Source, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Source, getSourceString, ZEND_ACC_PUBLIC) + PHP_V8_ME(Source, getScriptOrigin, ZEND_ACC_PUBLIC) + PHP_V8_ME(Source, getCachedData, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_stack_frame.cc b/src/php_v8_stack_frame.cc index 99e9b0d..6ee5e1b 100644 --- a/src/php_v8_stack_frame.cc +++ b/src/php_v8_stack_frame.cc @@ -187,7 +187,7 @@ static PHP_METHOD(StackFrame, isConstructor) { RETVAL_ZVAL(zend_read_property(this_ce, getThis(), ZEND_STRL("is_constructor"), 0, &rv), 1, 0); } -ZEND_BEGIN_ARG_INFO_EX(arginfo_stack_frame___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_ARG_TYPE_INFO(0, line_number, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, column, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, script_id, IS_LONG, 0) @@ -198,44 +198,41 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_stack_frame___construct, ZEND_SEND_BY_VAL, ZEND_R ZEND_ARG_TYPE_INFO(0, is_constructor, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_getLineNumber, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getLineNumber, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_getColumn, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getColumn, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_getScriptId, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getScriptId, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_getScriptName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getScriptName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_getScriptNameOrSourceURL, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getScriptNameOrSourceURL, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_getFunctionName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getFunctionName, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_isEval, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isEval, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_frame_isConstructor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isConstructor, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_stack_frame_methods[] = { - PHP_ME(StackFrame, __construct, arginfo_stack_frame___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(StackFrame, getLineNumber, arginfo_stack_frame_getLineNumber, ZEND_ACC_PUBLIC) - PHP_ME(StackFrame, getColumn, arginfo_stack_frame_getColumn, ZEND_ACC_PUBLIC) - PHP_ME(StackFrame, getScriptId, arginfo_stack_frame_getScriptId, ZEND_ACC_PUBLIC) - - PHP_ME(StackFrame, getScriptName, arginfo_stack_frame_getScriptName, ZEND_ACC_PUBLIC) - PHP_ME(StackFrame, getScriptNameOrSourceURL, arginfo_stack_frame_getScriptNameOrSourceURL, ZEND_ACC_PUBLIC) - PHP_ME(StackFrame, getFunctionName, arginfo_stack_frame_getFunctionName, ZEND_ACC_PUBLIC) - - PHP_ME(StackFrame, isEval, arginfo_stack_frame_isEval, ZEND_ACC_PUBLIC) - PHP_ME(StackFrame, isConstructor, arginfo_stack_frame_isConstructor, ZEND_ACC_PUBLIC) + PHP_V8_ME(StackFrame, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(StackFrame, getLineNumber, ZEND_ACC_PUBLIC) + PHP_V8_ME(StackFrame, getColumn, ZEND_ACC_PUBLIC) + PHP_V8_ME(StackFrame, getScriptId, ZEND_ACC_PUBLIC) + PHP_V8_ME(StackFrame, getScriptName, ZEND_ACC_PUBLIC) + PHP_V8_ME(StackFrame, getScriptNameOrSourceURL, ZEND_ACC_PUBLIC) + PHP_V8_ME(StackFrame, getFunctionName, ZEND_ACC_PUBLIC) + PHP_V8_ME(StackFrame, isEval, ZEND_ACC_PUBLIC) + PHP_V8_ME(StackFrame, isConstructor, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_stack_trace.cc b/src/php_v8_stack_trace.cc index c680ad4..b029181 100644 --- a/src/php_v8_stack_trace.cc +++ b/src/php_v8_stack_trace.cc @@ -142,35 +142,32 @@ static PHP_METHOD(StackTrace, currentStackTrace) php_v8_stack_trace_create_from_stack_trace(return_value, php_v8_isolate, trace); } -ZEND_BEGIN_ARG_INFO_EX(arginfo_stack_trace___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, frames, IS_ARRAY, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_trace_getFrames, ZEND_RETURN_VALUE, 0, IS_ARRAY, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getFrames, ZEND_RETURN_VALUE, 0, IS_ARRAY, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_stack_trace_getFrame, ZEND_RETURN_VALUE, 1, V8\\StackFrame, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getFrame, ZEND_RETURN_VALUE, 1, V8\\StackFrame, 0) ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_stack_trace_getFrameCount, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getFrameCount, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_stack_trace_currentStackTrace, ZEND_RETURN_VALUE, 2, V8\\StackTrace, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_currentStackTrace, ZEND_RETURN_VALUE, 2, V8\\StackTrace, 0) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_TYPE_INFO(0, frame_limit, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_stack_trace_methods[] = { - PHP_ME(StackTrace, __construct, arginfo_stack_trace___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(StackTrace, getFrames, arginfo_stack_trace_getFrames, ZEND_ACC_PUBLIC) - - PHP_ME(StackTrace, getFrame, arginfo_stack_trace_getFrame, ZEND_ACC_PUBLIC) - PHP_ME(StackTrace, getFrameCount, arginfo_stack_trace_getFrameCount, ZEND_ACC_PUBLIC) - - PHP_ME(StackTrace, currentStackTrace, arginfo_stack_trace_currentStackTrace, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(StackTrace, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(StackTrace, getFrames, ZEND_ACC_PUBLIC) + PHP_V8_ME(StackTrace, getFrame, ZEND_ACC_PUBLIC) + PHP_V8_ME(StackTrace, getFrameCount, ZEND_ACC_PUBLIC) + PHP_V8_ME(StackTrace, currentStackTrace, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/src/php_v8_startup_data.cc b/src/php_v8_startup_data.cc index 7e89d7d..3e2c99a 100644 --- a/src/php_v8_startup_data.cc +++ b/src/php_v8_startup_data.cc @@ -141,28 +141,26 @@ static PHP_METHOD(StartupData, createFromSource) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_startup_data___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_TYPE_INFO(0, blob, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_startup_data_getData, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getData, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_startup_data_getRawSize, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getRawSize, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_startup_data_createFromSource, ZEND_RETURN_VALUE, 1, V8\\StartupData, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_createFromSource, ZEND_RETURN_VALUE, 1, V8\\StartupData, 0) ZEND_ARG_TYPE_INFO(0, source, IS_STRING, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_startup_data_methods[] = { - PHP_ME(StartupData, __construct, arginfo_startup_data___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(StartupData, getData, arginfo_startup_data_getData, ZEND_ACC_PUBLIC) - PHP_ME(StartupData, getRawSize, arginfo_startup_data_getRawSize, ZEND_ACC_PUBLIC) - - PHP_ME(StartupData, createFromSource, arginfo_startup_data_createFromSource, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(StartupData, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(StartupData, getData, ZEND_ACC_PUBLIC) + PHP_V8_ME(StartupData, getRawSize, ZEND_ACC_PUBLIC) + PHP_V8_ME(StartupData, createFromSource, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/src/php_v8_string.cc b/src/php_v8_string.cc index 4a85086..4f3a852 100644 --- a/src/php_v8_string.cc +++ b/src/php_v8_string.cc @@ -127,34 +127,35 @@ static PHP_METHOD(String, containsOnlyOneByte) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_string___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string_value, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string_length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string_utf8Length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_utf8Length, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string_isOneByte, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_isOneByte, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_string_containsOnlyOneByte, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_containsOnlyOneByte, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_string_methods[] = { - PHP_ME(String, __construct, arginfo_string___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(String, value, arginfo_string_value, ZEND_ACC_PUBLIC) - PHP_ME(String, length, arginfo_string_length, ZEND_ACC_PUBLIC) - PHP_ME(String, utf8Length, arginfo_string_utf8Length, ZEND_ACC_PUBLIC) - PHP_ME(String, isOneByte, arginfo_string_isOneByte, ZEND_ACC_PUBLIC) - PHP_ME(String, containsOnlyOneByte, arginfo_string_containsOnlyOneByte, ZEND_ACC_PUBLIC) + PHP_V8_ME(String, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(String, value, ZEND_ACC_PUBLIC) + PHP_V8_ME(String, length, ZEND_ACC_PUBLIC) + PHP_V8_ME(String, utf8Length, ZEND_ACC_PUBLIC) + PHP_V8_ME(String, isOneByte, ZEND_ACC_PUBLIC) + PHP_V8_ME(String, containsOnlyOneByte, ZEND_ACC_PUBLIC) + PHP_FE_END }; diff --git a/src/php_v8_string_object.cc b/src/php_v8_string_object.cc index 45bbb5f..e8f24ef 100644 --- a/src/php_v8_string_object.cc +++ b/src/php_v8_string_object.cc @@ -62,19 +62,18 @@ static PHP_METHOD(StringObject, valueOf) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_string_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\StringValue, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_string_object_valueOf, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo_valueOf, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_string_object_methods[] = { - PHP_ME(StringObject, __construct, arginfo_string_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(StringObject, valueOf, arginfo_string_object_valueOf, ZEND_ACC_PUBLIC) + PHP_V8_ME(StringObject, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(StringObject, valueOf, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_symbol.cc b/src/php_v8_symbol.cc index 2620bc9..2ed250e 100644 --- a/src/php_v8_symbol.cc +++ b/src/php_v8_symbol.cc @@ -172,23 +172,23 @@ static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(Symbol, ToStringTag); static PHP_V8_SYMBOL_WELL_KNOWN_METHOD(Symbol, Unscopables); -ZEND_BEGIN_ARG_INFO_EX(arginfo_symbol___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_OBJ_INFO(0, name, V8\\StringValue, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_symbol_value, ZEND_RETURN_VALUE, 0, IS_STRING, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value, ZEND_RETURN_VALUE, 0, IS_STRING, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_symbol_name, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_name, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_symbol_for, ZEND_RETURN_VALUE, 2, V8\\SymbolValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_for, ZEND_RETURN_VALUE, 2, V8\\SymbolValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, name, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_symbol_forApi, ZEND_RETURN_VALUE, 2, V8\\SymbolValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_forApi, ZEND_RETURN_VALUE, 2, V8\\SymbolValue, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, name, V8\\StringValue, 0) ZEND_END_ARG_INFO() @@ -199,39 +199,36 @@ ZEND_END_ARG_INFO() ZEND_END_ARG_INFO() \ // Well-known symbols -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getHasInstance); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getIsConcatSpreadable); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getIterator); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getMatch); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getReplace); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getSearch); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getSplit); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getToPrimitive); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getToStringTag); -PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_symbol_getUnscopables); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_getHasInstance); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_getIsConcatSpreadable); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_getIterator); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_getMatch); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_getReplace); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_getSearch); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_getSplit); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_getToPrimitive); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_getToStringTag); +PHP_V8_SYMBOL_WELL_KNOWN_ARGS(arginfo_getUnscopables); static const zend_function_entry php_v8_symbol_methods[] = { - PHP_ME(Symbol, __construct, arginfo_symbol___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(Symbol, value, arginfo_symbol_value, ZEND_ACC_PUBLIC) - - PHP_ME(Symbol, name, arginfo_symbol_name, ZEND_ACC_PUBLIC) - - PHP_ME(Symbol, for, arginfo_symbol_for, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Symbol, forApi, arginfo_symbol_forApi, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Symbol, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Symbol, value, ZEND_ACC_PUBLIC) + PHP_V8_ME(Symbol, name, ZEND_ACC_PUBLIC) + PHP_V8_ME(Symbol, for, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Symbol, forApi, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) // Well-known symbols - PHP_ME(Symbol, getHasInstance, arginfo_symbol_getHasInstance, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Symbol, getIsConcatSpreadable, arginfo_symbol_getIsConcatSpreadable, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Symbol, getIterator, arginfo_symbol_getIterator, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Symbol, getMatch, arginfo_symbol_getMatch, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Symbol, getReplace, arginfo_symbol_getReplace, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Symbol, getSearch, arginfo_symbol_getSearch, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Symbol, getSplit, arginfo_symbol_getSplit, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Symbol, getToPrimitive, arginfo_symbol_getToPrimitive, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Symbol, getToStringTag, arginfo_symbol_getToStringTag, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) - PHP_ME(Symbol, getUnscopables, arginfo_symbol_getUnscopables, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Symbol, getHasInstance, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Symbol, getIsConcatSpreadable, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Symbol, getIterator, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Symbol, getMatch, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Symbol, getReplace, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Symbol, getSearch, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Symbol, getSplit, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Symbol, getToPrimitive, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Symbol, getToStringTag, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) + PHP_V8_ME(Symbol, getUnscopables, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) PHP_FE_END }; diff --git a/src/php_v8_symbol_object.cc b/src/php_v8_symbol_object.cc index bf7487e..95e6a13 100644 --- a/src/php_v8_symbol_object.cc +++ b/src/php_v8_symbol_object.cc @@ -63,19 +63,18 @@ static PHP_METHOD(SymbolObject, valueOf) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_symbol_object___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\SymbolValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_symbol_object_valueOf, ZEND_RETURN_VALUE, 0, V8\\SymbolValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_valueOf, ZEND_RETURN_VALUE, 0, V8\\SymbolValue, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_symbol_object_methods[] = { - PHP_ME(SymbolObject, __construct, arginfo_symbol_object___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(SymbolObject, valueOf, arginfo_symbol_object_valueOf, ZEND_ACC_PUBLIC) + PHP_V8_ME(SymbolObject, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(SymbolObject, valueOf, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_template.cc b/src/php_v8_template.cc index 8ae692a..04a415b 100644 --- a/src/php_v8_template.cc +++ b/src/php_v8_template.cc @@ -291,16 +291,16 @@ void php_v8_template_SetNativeDataProperty(v8::Isolate *isolate, v8::Local lo } -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_template_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_template_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_set, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, value, V8\\Data, 0) ZEND_ARG_TYPE_INFO(0, attributes, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_template_setAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setAccessorProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_OBJ_INFO(0, getter, V8\\FunctionTemplate, 0) ZEND_ARG_OBJ_INFO(0, setter, V8\\FunctionTemplate, 0) @@ -308,7 +308,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_template_setAccessorProperty, ZEND_SEND_BY ZEND_ARG_TYPE_INFO(0, settings, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_template_setNativeDataProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo_setNativeDataProperty, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, name, V8\\NameValue, 0) ZEND_ARG_CALLABLE_INFO(0, getter, 0) ZEND_ARG_CALLABLE_INFO(0, setter, 1) @@ -318,10 +318,10 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_php_v8_template_setNativeDataProperty, ZEND_SEND_ ZEND_END_ARG_INFO() static const zend_function_entry php_v8_template_methods[] = { - PHP_ABSTRACT_ME(Template, getIsolate, arginfo_template_getIsolate) - PHP_ABSTRACT_ME(Template, set, arginfo_php_v8_template_set) - PHP_ABSTRACT_ME(Template, setAccessorProperty, arginfo_php_v8_template_setAccessorProperty) - PHP_ABSTRACT_ME(Template, setNativeDataProperty, arginfo_php_v8_template_setNativeDataProperty) + PHP_V8_ABSTRACT_ME(Template, getIsolate) + PHP_V8_ABSTRACT_ME(Template, set) + PHP_V8_ABSTRACT_ME(Template, setAccessorProperty) + PHP_V8_ABSTRACT_ME(Template, setNativeDataProperty) PHP_FE_END }; diff --git a/src/php_v8_try_catch.cc b/src/php_v8_try_catch.cc index 4fc2eb5..3fb2780 100644 --- a/src/php_v8_try_catch.cc +++ b/src/php_v8_try_catch.cc @@ -228,7 +228,7 @@ static PHP_METHOD(TryCatch, getExternalException) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_try_catch___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, exception, V8\\Value, 1) @@ -239,45 +239,42 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_try_catch___construct, ZEND_SEND_BY_VAL, ZEND_RET ZEND_ARG_OBJ_INFO(0, external_exception, Throwable, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_try_catch_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_try_catch_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getContext, ZEND_RETURN_VALUE, 0, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_try_catch_exception, ZEND_RETURN_VALUE, 0, V8\\Value, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_exception, ZEND_RETURN_VALUE, 0, V8\\Value, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_try_catch_stackTrace, ZEND_RETURN_VALUE, 0, V8\\Value, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_stackTrace, ZEND_RETURN_VALUE, 0, V8\\Value, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_try_catch_message, ZEND_RETURN_VALUE, 0, V8\\Message, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_message, ZEND_RETURN_VALUE, 0, V8\\Message, 1) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_try_catch_canContinue, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_canContinue, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_try_catch_hasTerminated, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_hasTerminated, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_try_catch_getExternalException, ZEND_RETURN_VALUE, 0, Throwable, 1) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getExternalException, ZEND_RETURN_VALUE, 0, Throwable, 1) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_try_catch_methods[] = { - PHP_ME(TryCatch, __construct, arginfo_try_catch___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - - PHP_ME(TryCatch, getIsolate, arginfo_try_catch_getIsolate, ZEND_ACC_PUBLIC) - PHP_ME(TryCatch, getContext, arginfo_try_catch_getContext, ZEND_ACC_PUBLIC) - - PHP_ME(TryCatch, exception, arginfo_try_catch_exception, ZEND_ACC_PUBLIC) - PHP_ME(TryCatch, stackTrace, arginfo_try_catch_stackTrace, ZEND_ACC_PUBLIC) - PHP_ME(TryCatch, message, arginfo_try_catch_message, ZEND_ACC_PUBLIC) - - PHP_ME(TryCatch, canContinue, arginfo_try_catch_canContinue, ZEND_ACC_PUBLIC) - PHP_ME(TryCatch, hasTerminated, arginfo_try_catch_hasTerminated, ZEND_ACC_PUBLIC) - - PHP_ME(TryCatch, getExternalException, arginfo_try_catch_getExternalException, ZEND_ACC_PUBLIC) + PHP_V8_ME(TryCatch, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(TryCatch, getIsolate, ZEND_ACC_PUBLIC) + PHP_V8_ME(TryCatch, getContext, ZEND_ACC_PUBLIC) + PHP_V8_ME(TryCatch, exception, ZEND_ACC_PUBLIC) + PHP_V8_ME(TryCatch, stackTrace, ZEND_ACC_PUBLIC) + PHP_V8_ME(TryCatch, message, ZEND_ACC_PUBLIC) + PHP_V8_ME(TryCatch, canContinue, ZEND_ACC_PUBLIC) + PHP_V8_ME(TryCatch, hasTerminated, ZEND_ACC_PUBLIC) + + PHP_V8_ME(TryCatch, getExternalException, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_uint32.cc b/src/php_v8_uint32.cc index 6716945..c0ff0c0 100644 --- a/src/php_v8_uint32.cc +++ b/src/php_v8_uint32.cc @@ -58,18 +58,18 @@ static PHP_METHOD(Uint32, value) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_uint32___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 2) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_ARG_TYPE_INFO(0, value, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_uint32_value, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_uint32_methods[] = { - PHP_ME(Uint32, __construct, arginfo_uint32___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(Uint32, value, arginfo_uint32_value, ZEND_ACC_PUBLIC) + PHP_V8_ME(Uint32, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Uint32, value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_unbound_script.cc b/src/php_v8_unbound_script.cc index 15cf7ad..f6fb99a 100644 --- a/src/php_v8_unbound_script.cc +++ b/src/php_v8_unbound_script.cc @@ -194,42 +194,42 @@ static PHP_METHOD(UnboundScript, getLineNumber) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_unbound_script___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_unbound_script_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_unbound_script_bindToContext, ZEND_RETURN_VALUE, 1, V8\\Script, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_bindToContext, ZEND_RETURN_VALUE, 1, V8\\Script, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_unbound_script_getId, ZEND_RETURN_VALUE, 0, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getId, ZEND_RETURN_VALUE, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_unbound_script_getScriptName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getScriptName, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_unbound_script_getSourceURL, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getSourceURL, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_unbound_script_getSourceMappingURL, ZEND_RETURN_VALUE, 0, V8\\Value, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getSourceMappingURL, ZEND_RETURN_VALUE, 0, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_unbound_script_getLineNumber, ZEND_RETURN_VALUE, 1, IS_LONG, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_getLineNumber, ZEND_RETURN_VALUE, 1, IS_LONG, 0) ZEND_ARG_TYPE_INFO(0, code_pos, IS_LONG, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_unbound_script_methods[] = { - PHP_ME(UnboundScript, __construct, arginfo_unbound_script___construct, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) - PHP_ME(UnboundScript, getIsolate, arginfo_unbound_script_getIsolate, ZEND_ACC_PUBLIC) - PHP_ME(UnboundScript, bindToContext, arginfo_unbound_script_bindToContext, ZEND_ACC_PUBLIC) - PHP_ME(UnboundScript, getId, arginfo_unbound_script_getId, ZEND_ACC_PUBLIC) - PHP_ME(UnboundScript, getScriptName, arginfo_unbound_script_getScriptName, ZEND_ACC_PUBLIC) - PHP_ME(UnboundScript, getSourceURL, arginfo_unbound_script_getSourceURL, ZEND_ACC_PUBLIC) - PHP_ME(UnboundScript, getSourceMappingURL, arginfo_unbound_script_getSourceMappingURL, ZEND_ACC_PUBLIC) - PHP_ME(UnboundScript, getLineNumber, arginfo_unbound_script_getLineNumber, ZEND_ACC_PUBLIC) + PHP_V8_ME(UnboundScript, __construct, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) + PHP_V8_ME(UnboundScript, getIsolate, ZEND_ACC_PUBLIC) + PHP_V8_ME(UnboundScript, bindToContext, ZEND_ACC_PUBLIC) + PHP_V8_ME(UnboundScript, getId, ZEND_ACC_PUBLIC) + PHP_V8_ME(UnboundScript, getScriptName, ZEND_ACC_PUBLIC) + PHP_V8_ME(UnboundScript, getSourceURL, ZEND_ACC_PUBLIC) + PHP_V8_ME(UnboundScript, getSourceMappingURL, ZEND_ACC_PUBLIC) + PHP_V8_ME(UnboundScript, getLineNumber, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_undefined.cc b/src/php_v8_undefined.cc index 2da4fde..cf9a81f 100644 --- a/src/php_v8_undefined.cc +++ b/src/php_v8_undefined.cc @@ -46,17 +46,17 @@ static PHP_METHOD(Undefined, value) } -ZEND_BEGIN_ARG_INFO_EX(arginfo_undefined___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_undefined_value, ZEND_RETURN_VALUE, 0, IS_NULL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value, ZEND_RETURN_VALUE, 0, IS_NULL, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_undefined_methods[] = { - PHP_ME(Undefined, __construct, arginfo_undefined___construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) - PHP_ME(Undefined, value, arginfo_undefined_value, ZEND_ACC_PUBLIC) + PHP_V8_ME(Undefined, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR) + PHP_V8_ME(Undefined, value, ZEND_ACC_PUBLIC) PHP_FE_END }; diff --git a/src/php_v8_value.cc b/src/php_v8_value.cc index bb31d3c..2052005 100644 --- a/src/php_v8_value.cc +++ b/src/php_v8_value.cc @@ -923,16 +923,16 @@ static PHP_METHOD(Value, instanceOf) { } -ZEND_BEGIN_ARG_INFO_EX(arginfo_value___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo___construct, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_value_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_getIsolate, ZEND_RETURN_VALUE, 0, V8\\Isolate, 0) ZEND_END_ARG_INFO() #define PHP_V8_VALUE_IS_METHOD_ARG_INFO(method) \ - PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value_is##method, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) \ + PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_is##method, ZEND_RETURN_VALUE, 0, _IS_BOOL, 0) \ ZEND_END_ARG_INFO() \ PHP_V8_VALUE_IS_METHOD_ARG_INFO(Undefined) @@ -986,161 +986,156 @@ PHP_V8_VALUE_IS_METHOD_ARG_INFO(Proxy) //PHP_V8_VALUE_IS_METHOD_ARG_INFO(WebAssemblyCompiledModule) // Experimental -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toBoolean, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_toBoolean, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toNumber, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_toNumber, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toString, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_toString, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toDetailString, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_toDetailString, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toObject, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_toObject, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toInteger, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_toInteger, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toUint32, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_toUint32, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toInt32, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_toInt32, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_toArrayIndex, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_toArrayIndex, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_booleanValue, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_booleanValue, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_numberValue, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_numberValue, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_integerValue, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_integerValue, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_int32Value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_int32Value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_value_uint32Value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_uint32Value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 1) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value_equals, ZEND_RETURN_VALUE, 2, _IS_BOOL, 2) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_equals, ZEND_RETURN_VALUE, 2, _IS_BOOL, 2) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, that, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value_strictEquals, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_strictEquals, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, that, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value_sameValue, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_sameValue, ZEND_RETURN_VALUE, 1, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, that, V8\\Value, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_value_typeOf, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_typeOf, ZEND_RETURN_VALUE, 0, V8\\StringValue, 0) ZEND_END_ARG_INFO() -PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value_instanceOf, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) +PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_instanceOf, ZEND_RETURN_VALUE, 2, _IS_BOOL, 0) ZEND_ARG_OBJ_INFO(0, context, V8\\Context, 0) ZEND_ARG_OBJ_INFO(0, object, V8\\ObjectValue, 0) ZEND_END_ARG_INFO() static const zend_function_entry php_v8_value_methods[] = { -// PHP_ME(Value, __construct, arginfo_value___construct, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) - - PHP_ME(Value, getIsolate, arginfo_value_getIsolate, ZEND_ACC_PUBLIC) - - PHP_ME(Value, isUndefined, arginfo_value_isUndefined, ZEND_ACC_PUBLIC) - PHP_ME(Value, isNull, arginfo_value_isNull, ZEND_ACC_PUBLIC) - PHP_ME(Value, isNullOrUndefined, arginfo_value_isNullOrUndefined, ZEND_ACC_PUBLIC) - PHP_ME(Value, isTrue, arginfo_value_isTrue, ZEND_ACC_PUBLIC) - PHP_ME(Value, isFalse, arginfo_value_isFalse, ZEND_ACC_PUBLIC) - PHP_ME(Value, isName, arginfo_value_isName, ZEND_ACC_PUBLIC) - PHP_ME(Value, isString, arginfo_value_isString, ZEND_ACC_PUBLIC) - PHP_ME(Value, isSymbol, arginfo_value_isSymbol, ZEND_ACC_PUBLIC) - PHP_ME(Value, isFunction, arginfo_value_isFunction, ZEND_ACC_PUBLIC) - PHP_ME(Value, isArray, arginfo_value_isArray, ZEND_ACC_PUBLIC) - PHP_ME(Value, isObject, arginfo_value_isObject, ZEND_ACC_PUBLIC) - PHP_ME(Value, isBoolean, arginfo_value_isBoolean, ZEND_ACC_PUBLIC) - PHP_ME(Value, isNumber, arginfo_value_isNumber, ZEND_ACC_PUBLIC) - PHP_ME(Value, isInt32, arginfo_value_isInt32, ZEND_ACC_PUBLIC) - PHP_ME(Value, isUint32, arginfo_value_isUint32, ZEND_ACC_PUBLIC) - PHP_ME(Value, isDate, arginfo_value_isDate, ZEND_ACC_PUBLIC) - PHP_ME(Value, isArgumentsObject, arginfo_value_isArgumentsObject, ZEND_ACC_PUBLIC) - PHP_ME(Value, isBooleanObject, arginfo_value_isBooleanObject, ZEND_ACC_PUBLIC) - PHP_ME(Value, isNumberObject, arginfo_value_isNumberObject, ZEND_ACC_PUBLIC) - PHP_ME(Value, isStringObject, arginfo_value_isStringObject, ZEND_ACC_PUBLIC) - PHP_ME(Value, isSymbolObject, arginfo_value_isSymbolObject, ZEND_ACC_PUBLIC) - PHP_ME(Value, isNativeError, arginfo_value_isNativeError, ZEND_ACC_PUBLIC) - PHP_ME(Value, isRegExp, arginfo_value_isRegExp, ZEND_ACC_PUBLIC) - PHP_ME(Value, isAsyncFunction, arginfo_value_isAsyncFunction, ZEND_ACC_PUBLIC) - PHP_ME(Value, isGeneratorFunction, arginfo_value_isGeneratorFunction, ZEND_ACC_PUBLIC) - PHP_ME(Value, isGeneratorObject, arginfo_value_isGeneratorObject, ZEND_ACC_PUBLIC) - PHP_ME(Value, isPromise, arginfo_value_isPromise, ZEND_ACC_PUBLIC) - PHP_ME(Value, isMap, arginfo_value_isMap, ZEND_ACC_PUBLIC) - PHP_ME(Value, isSet, arginfo_value_isSet, ZEND_ACC_PUBLIC) - PHP_ME(Value, isMapIterator, arginfo_value_isMapIterator, ZEND_ACC_PUBLIC) - PHP_ME(Value, isSetIterator, arginfo_value_isSetIterator, ZEND_ACC_PUBLIC) - PHP_ME(Value, isWeakMap, arginfo_value_isWeakMap, ZEND_ACC_PUBLIC) - PHP_ME(Value, isWeakSet, arginfo_value_isWeakSet, ZEND_ACC_PUBLIC) - PHP_ME(Value, isArrayBuffer, arginfo_value_isArrayBuffer, ZEND_ACC_PUBLIC) - PHP_ME(Value, isArrayBufferView, arginfo_value_isArrayBufferView, ZEND_ACC_PUBLIC) - PHP_ME(Value, isTypedArray, arginfo_value_isTypedArray, ZEND_ACC_PUBLIC) - PHP_ME(Value, isUint8Array, arginfo_value_isUint8Array, ZEND_ACC_PUBLIC) - PHP_ME(Value, isUint8ClampedArray, arginfo_value_isUint8ClampedArray, ZEND_ACC_PUBLIC) - PHP_ME(Value, isInt8Array, arginfo_value_isInt8Array, ZEND_ACC_PUBLIC) - PHP_ME(Value, isUint16Array, arginfo_value_isUint16Array, ZEND_ACC_PUBLIC) - PHP_ME(Value, isInt16Array, arginfo_value_isInt16Array, ZEND_ACC_PUBLIC) - PHP_ME(Value, isUint32Array, arginfo_value_isUint32Array, ZEND_ACC_PUBLIC) - PHP_ME(Value, isInt32Array, arginfo_value_isInt32Array, ZEND_ACC_PUBLIC) - PHP_ME(Value, isFloat32Array, arginfo_value_isFloat32Array, ZEND_ACC_PUBLIC) - PHP_ME(Value, isFloat64Array, arginfo_value_isFloat64Array, ZEND_ACC_PUBLIC) - PHP_ME(Value, isDataView, arginfo_value_isDataView, ZEND_ACC_PUBLIC) - PHP_ME(Value, isSharedArrayBuffer, arginfo_value_isSharedArrayBuffer, ZEND_ACC_PUBLIC) - PHP_ME(Value, isProxy, arginfo_value_isProxy, ZEND_ACC_PUBLIC) - //PHP_ME(Value, isWebAssemblyCompiledModule, arginfo_value_isWebAssemblyCompiledModule, ZEND_ACC_PUBLIC) // Experimental - - PHP_ME(Value, toBoolean, arginfo_value_toBoolean, ZEND_ACC_PUBLIC) - PHP_ME(Value, toNumber, arginfo_value_toNumber, ZEND_ACC_PUBLIC) - PHP_ME(Value, toString, arginfo_value_toString, ZEND_ACC_PUBLIC) - PHP_ME(Value, toDetailString, arginfo_value_toDetailString, ZEND_ACC_PUBLIC) - PHP_ME(Value, toObject, arginfo_value_toObject, ZEND_ACC_PUBLIC) - PHP_ME(Value, toInteger, arginfo_value_toInteger, ZEND_ACC_PUBLIC) - PHP_ME(Value, toUint32, arginfo_value_toUint32, ZEND_ACC_PUBLIC) - PHP_ME(Value, toInt32, arginfo_value_toInt32, ZEND_ACC_PUBLIC) - PHP_ME(Value, toArrayIndex, arginfo_value_toArrayIndex, ZEND_ACC_PUBLIC) - - PHP_ME(Value, booleanValue, arginfo_value_booleanValue, ZEND_ACC_PUBLIC) - PHP_ME(Value, numberValue, arginfo_value_numberValue, ZEND_ACC_PUBLIC) - PHP_ME(Value, integerValue, arginfo_value_integerValue, ZEND_ACC_PUBLIC) - PHP_ME(Value, int32Value, arginfo_value_int32Value, ZEND_ACC_PUBLIC) - PHP_ME(Value, uint32Value, arginfo_value_uint32Value, ZEND_ACC_PUBLIC) - - PHP_ME(Value, equals, arginfo_value_equals, ZEND_ACC_PUBLIC) - PHP_ME(Value, strictEquals, arginfo_value_strictEquals, ZEND_ACC_PUBLIC) - PHP_ME(Value, sameValue, arginfo_value_sameValue, ZEND_ACC_PUBLIC) - PHP_ME(Value, typeOf, arginfo_value_typeOf, ZEND_ACC_PUBLIC) - PHP_ME(Value, instanceOf, arginfo_value_instanceOf, ZEND_ACC_PUBLIC) +// PHP_V8_ME(Value, __construct, ZEND_ACC_PRIVATE | ZEND_ACC_CTOR) + PHP_V8_ME(Value, getIsolate, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isUndefined, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isNull, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isNullOrUndefined, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isTrue, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isFalse, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isName, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isString, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isSymbol, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isFunction, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isArray, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isObject, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isBoolean, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isNumber, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isInt32, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isUint32, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isDate, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isArgumentsObject, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isBooleanObject, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isNumberObject, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isStringObject, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isSymbolObject, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isNativeError, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isRegExp, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isAsyncFunction, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isGeneratorFunction, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isGeneratorObject, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isPromise, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isMap, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isSet, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isMapIterator, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isSetIterator, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isWeakMap, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isWeakSet, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isArrayBuffer, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isArrayBufferView, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isTypedArray, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isUint8Array, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isUint8ClampedArray, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isInt8Array, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isUint16Array, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isInt16Array, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isUint32Array, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isInt32Array, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isFloat32Array, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isFloat64Array, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isDataView, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isSharedArrayBuffer, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, isProxy, ZEND_ACC_PUBLIC) + //PHP_V8_ME(Value, isWebAssemblyCompiledModule, ZEND_ACC_PUBLIC) // Experimental + PHP_V8_ME(Value, toBoolean, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, toNumber, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, toString, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, toDetailString, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, toObject, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, toInteger, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, toUint32, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, toInt32, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, toArrayIndex, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, booleanValue, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, numberValue, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, integerValue, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, int32Value, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, uint32Value, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, equals, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, strictEquals, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, sameValue, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, typeOf, ZEND_ACC_PUBLIC) + PHP_V8_ME(Value, instanceOf, ZEND_ACC_PUBLIC) PHP_FE_END };