0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-11-08 13:48:40 +00:00

remove TSRMLS_DC, TSRMLS_CC

This commit is contained in:
Stefan Siegl 2017-03-11 13:35:21 +01:00
parent d97832d9fb
commit 24bb1761bf
16 changed files with 193 additions and 193 deletions

View File

@ -85,7 +85,7 @@ v8::Local<v8::Value> zval_to_v8js(zval *, v8::Isolate *);
v8::Local<v8::Value> zend_long_to_v8js(zend_long, v8::Isolate *); v8::Local<v8::Value> zend_long_to_v8js(zend_long, v8::Isolate *);
/* Convert V8 value into zval */ /* Convert V8 value into zval */
int v8js_to_zval(v8::Local<v8::Value>, zval *, int, v8::Isolate * TSRMLS_DC); int v8js_to_zval(v8::Local<v8::Value>, zval *, int, v8::Isolate *);
struct v8js_accessor_ctx struct v8js_accessor_ctx
{ {
@ -93,10 +93,10 @@ struct v8js_accessor_ctx
v8::Isolate *isolate; v8::Isolate *isolate;
}; };
void v8js_accessor_ctx_dtor(v8js_accessor_ctx * TSRMLS_DC); void v8js_accessor_ctx_dtor(v8js_accessor_ctx *);
/* Register accessors into passed object */ /* Register accessors into passed object */
void v8js_register_accessors(std::vector<v8js_accessor_ctx*> *accessor_list, v8::Local<v8::FunctionTemplate>, zval *, v8::Isolate * TSRMLS_DC); void v8js_register_accessors(std::vector<v8js_accessor_ctx*> *accessor_list, v8::Local<v8::FunctionTemplate>, zval *, v8::Isolate *);
/* Forward declarations */ /* Forward declarations */

View File

@ -29,7 +29,7 @@ extern "C" {
} }
static zval v8js_array_access_dispatch(zend_object *object, const char *method_name, int param_count, static zval v8js_array_access_dispatch(zend_object *object, const char *method_name, int param_count,
uint32_t index, zval zvalue TSRMLS_DC) /* {{{ */ uint32_t index, zval zvalue) /* {{{ */
{ {
zend_fcall_info fci; zend_fcall_info fci;
zval php_value; zval php_value;
@ -52,7 +52,7 @@ static zval v8js_array_access_dispatch(zend_object *object, const char *method_n
fci.object = object; fci.object = object;
fci.no_separation = 0; fci.no_separation = 0;
zend_call_function(&fci, NULL TSRMLS_CC); zend_call_function(&fci, NULL);
zval_dtor(&fci.function_name); zval_dtor(&fci.function_name);
return php_value; return php_value;
} }
@ -72,8 +72,8 @@ void v8js_array_access_getter(uint32_t index, const v8::PropertyCallbackInfo<v8:
zval zvalue; zval zvalue;
ZVAL_UNDEF(&zvalue); ZVAL_UNDEF(&zvalue);
zval php_value = v8js_array_access_dispatch(object, "offsetGet", 1, index, zvalue TSRMLS_CC); zval php_value = v8js_array_access_dispatch(object, "offsetGet", 1, index, zvalue);
v8::Local<v8::Value> ret_value = zval_to_v8js(&php_value, isolate TSRMLS_CC); v8::Local<v8::Value> ret_value = zval_to_v8js(&php_value, isolate);
zval_ptr_dtor(&php_value); zval_ptr_dtor(&php_value);
info.GetReturnValue().Set(ret_value); info.GetReturnValue().Set(ret_value);
@ -93,12 +93,12 @@ void v8js_array_access_setter(uint32_t index, v8::Local<v8::Value> value,
zval zvalue; zval zvalue;
ZVAL_UNDEF(&zvalue); ZVAL_UNDEF(&zvalue);
if (v8js_to_zval(value, &zvalue, 0, isolate TSRMLS_CC) != SUCCESS) { if (v8js_to_zval(value, &zvalue, 0, isolate) != SUCCESS) {
info.GetReturnValue().Set(v8::Local<v8::Value>()); info.GetReturnValue().Set(v8::Local<v8::Value>());
return; return;
} }
zval php_value = v8js_array_access_dispatch(object, "offsetSet", 2, index, zvalue TSRMLS_CC); zval php_value = v8js_array_access_dispatch(object, "offsetSet", 2, index, zvalue);
zval_ptr_dtor(&php_value); zval_ptr_dtor(&php_value);
/* simply pass back the value to tell we intercepted the call /* simply pass back the value to tell we intercepted the call
@ -112,15 +112,15 @@ void v8js_array_access_setter(uint32_t index, v8::Local<v8::Value> value,
/* }}} */ /* }}} */
static int v8js_array_access_get_count_result(zend_object *object TSRMLS_DC) /* {{{ */ static int v8js_array_access_get_count_result(zend_object *object) /* {{{ */
{ {
zval zvalue; zval zvalue;
ZVAL_UNDEF(&zvalue); ZVAL_UNDEF(&zvalue);
zval php_value = v8js_array_access_dispatch(object, "count", 0, 0, zvalue TSRMLS_CC); zval php_value = v8js_array_access_dispatch(object, "count", 0, 0, zvalue);
if(Z_TYPE(php_value) != IS_LONG) { if(Z_TYPE(php_value) != IS_LONG) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Non-numeric return value from count() method"); php_error_docref(NULL, E_WARNING, "Non-numeric return value from count() method");
zval_ptr_dtor(&php_value); zval_ptr_dtor(&php_value);
return 0; return 0;
} }
@ -137,15 +137,15 @@ static int v8js_array_access_get_count_result(zend_object *object TSRMLS_DC) /*
} }
/* }}} */ /* }}} */
static bool v8js_array_access_isset_p(zend_object *object, int index TSRMLS_DC) /* {{{ */ static bool v8js_array_access_isset_p(zend_object *object, int index) /* {{{ */
{ {
zval zvalue; zval zvalue;
ZVAL_UNDEF(&zvalue); ZVAL_UNDEF(&zvalue);
zval php_value = v8js_array_access_dispatch(object, "offsetExists", 1, index, zvalue TSRMLS_CC); zval php_value = v8js_array_access_dispatch(object, "offsetExists", 1, index, zvalue);
if(Z_TYPE(php_value) != IS_TRUE && Z_TYPE(php_value) != IS_FALSE) { if(Z_TYPE(php_value) != IS_TRUE && Z_TYPE(php_value) != IS_FALSE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Non-boolean return value from offsetExists() method"); php_error_docref(NULL, E_WARNING, "Non-boolean return value from offsetExists() method");
zval_ptr_dtor(&php_value); zval_ptr_dtor(&php_value);
return false; return false;
} }
@ -164,7 +164,7 @@ static void v8js_array_access_length(v8::Local<v8::String> property, const v8::P
zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1)); zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1));
int length = v8js_array_access_get_count_result(object TSRMLS_CC); int length = v8js_array_access_get_count_result(object);
info.GetReturnValue().Set(V8JS_INT(length)); info.GetReturnValue().Set(V8JS_INT(length));
} }
/* }}} */ /* }}} */
@ -181,7 +181,7 @@ void v8js_array_access_deleter(uint32_t index, const v8::PropertyCallbackInfo<v8
zval zvalue; zval zvalue;
ZVAL_UNDEF(&zvalue); ZVAL_UNDEF(&zvalue);
zval php_value = v8js_array_access_dispatch(object, "offsetUnset", 1, index, zvalue TSRMLS_CC); zval php_value = v8js_array_access_dispatch(object, "offsetUnset", 1, index, zvalue);
zval_ptr_dtor(&php_value); zval_ptr_dtor(&php_value);
info.GetReturnValue().Set(V8JS_BOOL(true)); info.GetReturnValue().Set(V8JS_BOOL(true));
@ -199,7 +199,7 @@ void v8js_array_access_query(uint32_t index, const v8::PropertyCallbackInfo<v8::
/* If index is set, then return an integer encoding a v8::PropertyAttribute; /* If index is set, then return an integer encoding a v8::PropertyAttribute;
* otherwise we're expected to return an empty handle. */ * otherwise we're expected to return an empty handle. */
if(v8js_array_access_isset_p(object, index TSRMLS_CC)) { if(v8js_array_access_isset_p(object, index)) {
info.GetReturnValue().Set(V8JS_UINT(v8::PropertyAttribute::None)); info.GetReturnValue().Set(V8JS_UINT(v8::PropertyAttribute::None));
} }
} }
@ -215,13 +215,13 @@ void v8js_array_access_enumerator(const v8::PropertyCallbackInfo<v8::Array>& inf
zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1)); zend_object *object = reinterpret_cast<zend_object *>(self->GetAlignedPointerFromInternalField(1));
int length = v8js_array_access_get_count_result(object TSRMLS_CC); int length = v8js_array_access_get_count_result(object);
v8::Local<v8::Array> result = v8::Array::New(isolate, length); v8::Local<v8::Array> result = v8::Array::New(isolate, length);
int i = 0; int i = 0;
for(int j = 0; j < length; j ++) { for(int j = 0; j < length; j ++) {
if(v8js_array_access_isset_p(object, j TSRMLS_CC)) { if(v8js_array_access_isset_p(object, j)) {
result->Set(i ++, V8JS_INT(j)); result->Set(i ++, V8JS_INT(j));
} }
} }

View File

@ -82,11 +82,11 @@ public:
}; };
static void v8js_free_storage(zend_object *object TSRMLS_DC) /* {{{ */ static void v8js_free_storage(zend_object *object) /* {{{ */
{ {
v8js_ctx *c = v8js_ctx_fetch_object(object); v8js_ctx *c = v8js_ctx_fetch_object(object);
zend_object_std_dtor(&c->std TSRMLS_CC); zend_object_std_dtor(&c->std);
zval_ptr_dtor(&c->pending_exception); zval_ptr_dtor(&c->pending_exception);
zval_ptr_dtor(&c->module_normaliser); zval_ptr_dtor(&c->module_normaliser);
@ -134,7 +134,7 @@ static void v8js_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
/* Clear contexts */ /* Clear contexts */
for (std::vector<v8js_accessor_ctx*>::iterator it = c->accessor_list.begin(); for (std::vector<v8js_accessor_ctx*>::iterator it = c->accessor_list.begin();
it != c->accessor_list.end(); ++it) { it != c->accessor_list.end(); ++it) {
v8js_accessor_ctx_dtor(*it TSRMLS_CC); v8js_accessor_ctx_dtor(*it);
} }
c->accessor_list.~vector(); c->accessor_list.~vector();
@ -204,12 +204,12 @@ static void v8js_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
} }
/* }}} */ /* }}} */
static zend_object* v8js_new(zend_class_entry *ce TSRMLS_DC) /* {{{ */ static zend_object* v8js_new(zend_class_entry *ce) /* {{{ */
{ {
v8js_ctx *c; v8js_ctx *c;
c = (v8js_ctx *) ecalloc(1, sizeof(*c) + zend_object_properties_size(ce)); c = (v8js_ctx *) ecalloc(1, sizeof(*c) + zend_object_properties_size(ce));
zend_object_std_init(&c->std, ce TSRMLS_CC); zend_object_std_init(&c->std, ce);
object_properties_init(&c->std, ce); object_properties_init(&c->std, ce);
c->std.handlers = &v8js_object_handlers; c->std.handlers = &v8js_object_handlers;
@ -340,7 +340,7 @@ static PHP_METHOD(V8Js, __construct)
return; return;
} }
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|Saabz", &object_name, &vars_arr, &exts_arr, &report_uncaught, &snapshot_blob) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "|Saabz", &object_name, &vars_arr, &exts_arr, &report_uncaught, &snapshot_blob) == FAILURE) {
return; return;
} }
@ -372,7 +372,7 @@ static PHP_METHOD(V8Js, __construct)
c->snapshot_blob.raw_size = static_cast<int>(Z_STRLEN_P(snapshot_blob)); c->snapshot_blob.raw_size = static_cast<int>(Z_STRLEN_P(snapshot_blob));
c->create_params.snapshot_blob = &c->snapshot_blob; c->create_params.snapshot_blob = &c->snapshot_blob;
} else { } else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument snapshot_blob expected to be of string type"); php_error_docref(NULL, E_WARNING, "Argument snapshot_blob expected to be of string type");
} }
} }
@ -462,7 +462,7 @@ static PHP_METHOD(V8Js, __construct)
/* Register Get accessor for passed variables */ /* Register Get accessor for passed variables */
if (vars_arr && zend_hash_num_elements(Z_ARRVAL_P(vars_arr)) > 0) { if (vars_arr && zend_hash_num_elements(Z_ARRVAL_P(vars_arr)) > 0) {
v8js_register_accessors(&c->accessor_list, php_obj_t, vars_arr, isolate TSRMLS_CC); v8js_register_accessors(&c->accessor_list, php_obj_t, vars_arr, isolate);
} }
/* Set name for the PHP JS object */ /* Set name for the PHP JS object */
@ -490,12 +490,12 @@ static PHP_METHOD(V8Js, __construct)
V8JS_GLOBAL(isolate)->ForceSet(object_name_js, php_obj, v8::ReadOnly); V8JS_GLOBAL(isolate)->ForceSet(object_name_js, php_obj, v8::ReadOnly);
/* Export public property values */ /* Export public property values */
HashTable *properties = zend_std_get_properties(getThis() TSRMLS_CC); HashTable *properties = zend_std_get_properties(getThis());
zval *value; zval *value;
zend_string *member; zend_string *member;
ZEND_HASH_FOREACH_STR_KEY(properties, member) { ZEND_HASH_FOREACH_STR_KEY(properties, member) {
zend_property_info *property_info = zend_get_property_info(c->std.ce, member, 1 TSRMLS_CC); zend_property_info *property_info = zend_get_property_info(c->std.ce, member, 1);
if(property_info && if(property_info &&
property_info != ZEND_WRONG_PROPERTY_INFO && property_info != ZEND_WRONG_PROPERTY_INFO &&
(property_info->flags & ZEND_ACC_PUBLIC)) { (property_info->flags & ZEND_ACC_PUBLIC)) {
@ -510,7 +510,7 @@ static PHP_METHOD(V8Js, __construct)
/* Write value to PHP JS object */ /* Write value to PHP JS object */
value = OBJ_PROP(Z_OBJ_P(getThis()), property_info->offset); value = OBJ_PROP(Z_OBJ_P(getThis()), property_info->offset);
php_obj->ForceSet(key, zval_to_v8js(value, isolate TSRMLS_CC), v8::ReadOnly); php_obj->ForceSet(key, zval_to_v8js(value, isolate), v8::ReadOnly);
} }
} ZEND_HASH_FOREACH_END(); } ZEND_HASH_FOREACH_END();
@ -595,7 +595,7 @@ static PHP_METHOD(V8Js, __construct)
PHP_METHOD(V8Js, __sleep) PHP_METHOD(V8Js, __sleep)
{ {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"You cannot serialize or unserialize V8Js instances", 0 TSRMLS_CC); "You cannot serialize or unserialize V8Js instances", 0);
RETURN_FALSE; RETURN_FALSE;
} }
/* }}} */ /* }}} */
@ -605,12 +605,12 @@ PHP_METHOD(V8Js, __sleep)
PHP_METHOD(V8Js, __wakeup) PHP_METHOD(V8Js, __wakeup)
{ {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"You cannot serialize or unserialize V8Js instances", 0 TSRMLS_CC); "You cannot serialize or unserialize V8Js instances", 0);
RETURN_FALSE; RETURN_FALSE;
} }
/* }}} */ /* }}} */
static void v8js_compile_script(zval *this_ptr, const zend_string *str, const zend_string *identifier, v8js_script **ret TSRMLS_DC) static void v8js_compile_script(zval *this_ptr, const zend_string *str, const zend_string *identifier, v8js_script **ret)
{ {
v8js_script *res = NULL; v8js_script *res = NULL;
@ -642,7 +642,7 @@ static void v8js_compile_script(zval *this_ptr, const zend_string *str, const ze
/* Compile errors? */ /* Compile errors? */
if (script.IsEmpty()) { if (script.IsEmpty()) {
v8js_throw_script_exception(c->isolate, &try_catch TSRMLS_CC); v8js_throw_script_exception(c->isolate, &try_catch);
return; return;
} }
res = (v8js_script *)emalloc(sizeof(v8js_script)); res = (v8js_script *)emalloc(sizeof(v8js_script));
@ -655,7 +655,7 @@ static void v8js_compile_script(zval *this_ptr, const zend_string *str, const ze
return; return;
} }
static void v8js_execute_script(zval *this_ptr, v8js_script *res, long flags, long time_limit, long memory_limit, zval **return_value TSRMLS_DC) static void v8js_execute_script(zval *this_ptr, v8js_script *res, long flags, long time_limit, long memory_limit, zval **return_value)
{ {
v8js_ctx *c = Z_V8JS_CTX_OBJ_P(this_ptr); v8js_ctx *c = Z_V8JS_CTX_OBJ_P(this_ptr);
@ -681,7 +681,7 @@ static void v8js_execute_script(zval *this_ptr, v8js_script *res, long flags, lo
return script->Run(); return script->Run();
}; };
v8js_v8_call(c, return_value, flags, time_limit, memory_limit, v8_call TSRMLS_CC); v8js_v8_call(c, return_value, flags, time_limit, memory_limit, v8_call);
} }
if(V8JSG(fatal_error_abort)) { if(V8JSG(fatal_error_abort)) {
@ -699,17 +699,17 @@ static PHP_METHOD(V8Js, executeString)
long flags = V8JS_FLAG_NONE, time_limit = 0, memory_limit = 0; long flags = V8JS_FLAG_NONE, time_limit = 0, memory_limit = 0;
v8js_script *res = NULL; v8js_script *res = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|Slll", &str, &identifier, &flags, &time_limit, &memory_limit) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|Slll", &str, &identifier, &flags, &time_limit, &memory_limit) == FAILURE) {
return; return;
} }
v8js_compile_script(getThis(), str, identifier, &res TSRMLS_CC); v8js_compile_script(getThis(), str, identifier, &res);
if (!res) { if (!res) {
RETURN_FALSE; RETURN_FALSE;
} }
zend_try { zend_try {
v8js_execute_script(getThis(), res, flags, time_limit, memory_limit, &return_value TSRMLS_CC); v8js_execute_script(getThis(), res, flags, time_limit, memory_limit, &return_value);
v8js_script_free(res); v8js_script_free(res);
} }
zend_catch { zend_catch {
@ -730,11 +730,11 @@ static PHP_METHOD(V8Js, compileString)
zend_string *str = NULL, *identifier = NULL; zend_string *str = NULL, *identifier = NULL;
v8js_script *res = NULL; v8js_script *res = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|S", &str, &identifier) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|S", &str, &identifier) == FAILURE) {
return; return;
} }
v8js_compile_script(getThis(), str, identifier, &res TSRMLS_CC); v8js_compile_script(getThis(), str, identifier, &res);
if (res) { if (res) {
RETVAL_RES(zend_register_resource(res, le_v8js_script)); RETVAL_RES(zend_register_resource(res, le_v8js_script));
@ -754,7 +754,7 @@ static PHP_METHOD(V8Js, executeScript)
zval *zscript; zval *zscript;
v8js_script *res; v8js_script *res;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|lll", &zscript, &flags, &time_limit, &memory_limit) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|lll", &zscript, &flags, &time_limit, &memory_limit) == FAILURE) {
return; return;
} }
@ -762,7 +762,7 @@ static PHP_METHOD(V8Js, executeScript)
RETURN_FALSE; RETURN_FALSE;
} }
v8js_execute_script(getThis(), res, flags, time_limit, memory_limit, &return_value TSRMLS_CC); v8js_execute_script(getThis(), res, flags, time_limit, memory_limit, &return_value);
} }
/* }}} */ /* }}} */
@ -775,11 +775,11 @@ static PHP_METHOD(V8Js, checkString)
v8js_script *res = NULL; v8js_script *res = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &str) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &str) == FAILURE) {
return; return;
} }
v8js_compile_script(getThis(), str, identifier, &res TSRMLS_CC); v8js_compile_script(getThis(), str, identifier, &res);
zend_string_release(identifier); zend_string_release(identifier);
if (!res) { if (!res) {
@ -836,7 +836,7 @@ static PHP_METHOD(V8Js, setModuleNormaliser)
v8js_ctx *c; v8js_ctx *c;
zval *callable; zval *callable;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &callable) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &callable) == FAILURE) {
return; return;
} }
@ -852,7 +852,7 @@ static PHP_METHOD(V8Js, setModuleLoader)
v8js_ctx *c; v8js_ctx *c;
zval *callable; zval *callable;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &callable) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "z", &callable) == FAILURE) {
return; return;
} }
@ -868,7 +868,7 @@ static PHP_METHOD(V8Js, setTimeLimit)
v8js_ctx *c; v8js_ctx *c;
long time_limit = 0; long time_limit = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &time_limit) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &time_limit) == FAILURE) {
return; return;
} }
@ -904,7 +904,7 @@ static PHP_METHOD(V8Js, setMemoryLimit)
v8js_ctx *c; v8js_ctx *c;
long memory_limit = 0; long memory_limit = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &memory_limit) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &memory_limit) == FAILURE) {
return; return;
} }
@ -935,7 +935,7 @@ static PHP_METHOD(V8Js, setAverageObjectSize)
v8js_ctx *c; v8js_ctx *c;
long average_object_size = 0; long average_object_size = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &average_object_size) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &average_object_size) == FAILURE) {
return; return;
} }
@ -979,7 +979,7 @@ static void v8js_script_dtor(zend_resource *rsrc) /* {{{ */
} }
/* }}} */ /* }}} */
static int v8js_register_extension(zend_string *name, zend_string *source, zval *deps_arr, zend_bool auto_enable TSRMLS_DC) /* {{{ */ static int v8js_register_extension(zend_string *name, zend_string *source, zval *deps_arr, zend_bool auto_enable) /* {{{ */
{ {
v8js_jsext *jsext = NULL; v8js_jsext *jsext = NULL;
@ -1003,7 +1003,7 @@ static int v8js_register_extension(zend_string *name, zend_string *source, zval
jsext->deps_count = zend_hash_num_elements(Z_ARRVAL_P(deps_arr)); jsext->deps_count = zend_hash_num_elements(Z_ARRVAL_P(deps_arr));
if (v8js_create_ext_strarr(&jsext->deps, jsext->deps_count, Z_ARRVAL_P(deps_arr)) == FAILURE) { if (v8js_create_ext_strarr(&jsext->deps, jsext->deps_count, Z_ARRVAL_P(deps_arr)) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid dependency array passed"); php_error_docref(NULL, E_WARNING, "Invalid dependency array passed");
v8js_jsext_free_storage(jsext); v8js_jsext_free_storage(jsext);
#ifdef ZTS #ifdef ZTS
v8js_process_globals.lock.unlock(); v8js_process_globals.lock.unlock();
@ -1057,15 +1057,15 @@ static PHP_METHOD(V8Js, registerExtension)
zval *deps_arr = NULL; zval *deps_arr = NULL;
zend_bool auto_enable = 0; zend_bool auto_enable = 0;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|ab", &ext_name, &script, &deps_arr, &auto_enable) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|ab", &ext_name, &script, &deps_arr, &auto_enable) == FAILURE) {
return; return;
} }
if (!ZSTR_LEN(ext_name)) { if (!ZSTR_LEN(ext_name)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Extension name cannot be empty"); php_error_docref(NULL, E_WARNING, "Extension name cannot be empty");
} else if (!ZSTR_LEN(script)) { } else if (!ZSTR_LEN(script)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Script cannot be empty"); php_error_docref(NULL, E_WARNING, "Script cannot be empty");
} else if (v8js_register_extension(ext_name, script, deps_arr, auto_enable TSRMLS_CC) == SUCCESS) { } else if (v8js_register_extension(ext_name, script, deps_arr, auto_enable) == SUCCESS) {
RETURN_TRUE; RETURN_TRUE;
} }
RETURN_FALSE; RETURN_FALSE;
@ -1121,12 +1121,12 @@ static PHP_METHOD(V8Js, createSnapshot)
{ {
zend_string *script; zend_string *script;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S", &script) == FAILURE) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &script) == FAILURE) {
return; return;
} }
if (!ZSTR_LEN(script)) { if (!ZSTR_LEN(script)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Script cannot be empty"); php_error_docref(NULL, E_WARNING, "Script cannot be empty");
RETURN_FALSE; RETURN_FALSE;
} }
@ -1136,7 +1136,7 @@ static PHP_METHOD(V8Js, createSnapshot)
v8::StartupData snapshot_blob = v8::V8::CreateSnapshotDataBlob(ZSTR_VAL(script)); v8::StartupData snapshot_blob = v8::V8::CreateSnapshotDataBlob(ZSTR_VAL(script));
if (!snapshot_blob.data) { if (!snapshot_blob.data) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to create V8 heap snapshot. Check $embed_source for errors."); php_error_docref(NULL, E_WARNING, "Failed to create V8 heap snapshot. Check $embed_source for errors.");
RETURN_FALSE; RETURN_FALSE;
} }
@ -1253,12 +1253,12 @@ const zend_function_entry v8js_methods[] = { /* {{{ */
/* V8Js object handlers */ /* V8Js object handlers */
static void v8js_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) /* {{{ */ static void v8js_write_property(zval *object, zval *member, zval *value, void **cache_slot) /* {{{ */
{ {
V8JS_BEGIN_CTX(c, object) V8JS_BEGIN_CTX(c, object)
/* Check whether member is public, if so, export to V8. */ /* Check whether member is public, if so, export to V8. */
zend_property_info *property_info = zend_get_property_info(c->std.ce, Z_STR_P(member), 1 TSRMLS_CC); zend_property_info *property_info = zend_get_property_info(c->std.ce, Z_STR_P(member), 1);
if(!property_info || if(!property_info ||
(property_info != ZEND_WRONG_PROPERTY_INFO && (property_info != ZEND_WRONG_PROPERTY_INFO &&
(property_info->flags & ZEND_ACC_PUBLIC))) { (property_info->flags & ZEND_ACC_PUBLIC))) {
@ -1274,7 +1274,7 @@ static void v8js_write_property(zval *object, zval *member, zval *value, void **
/* Write value to PHP JS object */ /* Write value to PHP JS object */
v8::Local<v8::Value> key = V8JS_SYML(Z_STRVAL_P(member), static_cast<int>(Z_STRLEN_P(member))); v8::Local<v8::Value> key = V8JS_SYML(Z_STRVAL_P(member), static_cast<int>(Z_STRLEN_P(member)));
jsobj->ForceSet(key, zval_to_v8js(value, isolate TSRMLS_CC), v8::ReadOnly); jsobj->ForceSet(key, zval_to_v8js(value, isolate), v8::ReadOnly);
} }
/* Write value to PHP object */ /* Write value to PHP object */
@ -1282,7 +1282,7 @@ static void v8js_write_property(zval *object, zval *member, zval *value, void **
} }
/* }}} */ /* }}} */
static void v8js_unset_property(zval *object, zval *member, void **cache_slot TSRMLS_DC) /* {{{ */ static void v8js_unset_property(zval *object, zval *member, void **cache_slot) /* {{{ */
{ {
V8JS_BEGIN_CTX(c, object) V8JS_BEGIN_CTX(c, object)
@ -1311,7 +1311,7 @@ PHP_MINIT_FUNCTION(v8js_class) /* {{{ */
/* V8Js Class */ /* V8Js Class */
INIT_CLASS_ENTRY(ce, "V8Js", v8js_methods); INIT_CLASS_ENTRY(ce, "V8Js", v8js_methods);
php_ce_v8js = zend_register_internal_class(&ce TSRMLS_CC); php_ce_v8js = zend_register_internal_class(&ce);
php_ce_v8js->create_object = v8js_new; php_ce_v8js->create_object = v8js_new;
/* V8Js handlers */ /* V8Js handlers */
@ -1325,7 +1325,7 @@ PHP_MINIT_FUNCTION(v8js_class) /* {{{ */
zend_declare_class_constant_long(php_ce_v8js, ZEND_STRL("FLAG_NONE"), V8JS_FLAG_NONE TSRMLS_CC); zend_declare_class_constant_long(php_ce_v8js, ZEND_STRL("FLAG_NONE"), V8JS_FLAG_NONE TSRMLS_CC);
zend_declare_class_constant_long(php_ce_v8js, ZEND_STRL("FLAG_FORCE_ARRAY"), V8JS_FLAG_FORCE_ARRAY TSRMLS_CC); zend_declare_class_constant_long(php_ce_v8js, ZEND_STRL("FLAG_FORCE_ARRAY"), V8JS_FLAG_FORCE_ARRAY TSRMLS_CC);
zend_declare_class_constant_long(php_ce_v8js, ZEND_STRL("FLAG_PROPAGATE_PHP_EXCEPTIONS"), V8JS_FLAG_PROPAGATE_PHP_EXCEPTIONS TSRMLS_CC); zend_declare_class_constant_long(php_ce_v8js, ZEND_STRL("FLAG_PROPAGATE_PHP_EXCEPTIONS"), V8JS_FLAG_PROPAGATE_PHP_EXCEPTIONS);
le_v8js_script = zend_register_list_destructors_ex(v8js_script_dtor, NULL, PHP_V8JS_SCRIPT_RES_NAME, module_number); le_v8js_script = zend_register_list_destructors_ex(v8js_script_dtor, NULL, PHP_V8JS_SCRIPT_RES_NAME, module_number);

View File

@ -34,7 +34,7 @@ extern "C" {
#include "zend_exceptions.h" #include "zend_exceptions.h"
} }
static int v8js_is_assoc_array(HashTable *myht TSRMLS_DC) /* {{{ */ static int v8js_is_assoc_array(HashTable *myht) /* {{{ */
{ {
zend_string *key; zend_string *key;
zend_ulong index, idx = 0; zend_ulong index, idx = 0;
@ -57,14 +57,14 @@ static int v8js_is_assoc_array(HashTable *myht TSRMLS_DC) /* {{{ */
/* }}} */ /* }}} */
static v8::Local<v8::Value> v8js_hash_to_jsarr(zval *value, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ static v8::Local<v8::Value> v8js_hash_to_jsarr(zval *value, v8::Isolate *isolate) /* {{{ */
{ {
HashTable *myht = HASH_OF(value); HashTable *myht = HASH_OF(value);
int i = myht ? zend_hash_num_elements(myht) : 0; int i = myht ? zend_hash_num_elements(myht) : 0;
/* Return object if dealing with assoc array */ /* Return object if dealing with assoc array */
if (i > 0 && v8js_is_assoc_array(myht TSRMLS_CC)) { if (i > 0 && v8js_is_assoc_array(myht)) {
return v8js_hash_to_jsobj(value, isolate TSRMLS_CC); return v8js_hash_to_jsobj(value, isolate);
} }
v8::Local<v8::Array> newarr; v8::Local<v8::Array> newarr;
@ -89,7 +89,7 @@ static v8::Local<v8::Value> v8js_hash_to_jsarr(zval *value, v8::Isolate *isolate
ZEND_HASH_INC_APPLY_COUNT(myht); ZEND_HASH_INC_APPLY_COUNT(myht);
} }
newarr->Set(index++, zval_to_v8js(data, isolate TSRMLS_CC)); newarr->Set(index++, zval_to_v8js(data, isolate));
if (tmp_ht) { if (tmp_ht) {
ZEND_HASH_DEC_APPLY_COUNT(myht); ZEND_HASH_DEC_APPLY_COUNT(myht);
@ -127,21 +127,21 @@ v8::Local<v8::Value> zval_to_v8js(zval *value, v8::Isolate *isolate) /* {{{ */
break; break;
case IS_ARRAY: case IS_ARRAY:
jsValue = v8js_hash_to_jsarr(value, isolate TSRMLS_CC); jsValue = v8js_hash_to_jsarr(value, isolate);
break; break;
case IS_OBJECT: case IS_OBJECT:
if (V8JSG(use_date)) { if (V8JSG(use_date)) {
ce = php_date_get_date_ce(); ce = php_date_get_date_ce();
if (instanceof_function(Z_OBJCE_P(value), ce TSRMLS_CC)) { if (instanceof_function(Z_OBJCE_P(value), ce)) {
zval dtval; zval dtval;
zend_call_method_with_0_params(value, NULL, NULL, "getTimestamp", &dtval); zend_call_method_with_0_params(value, NULL, NULL, "getTimestamp", &dtval);
jsValue = V8JS_DATE(((double)Z_LVAL(dtval) * 1000.0)); jsValue = V8JS_DATE(((double)Z_LVAL(dtval) * 1000.0));
zval_dtor(&dtval); zval_dtor(&dtval);
} else } else
jsValue = v8js_hash_to_jsobj(value, isolate TSRMLS_CC); jsValue = v8js_hash_to_jsobj(value, isolate);
} else } else
jsValue = v8js_hash_to_jsobj(value, isolate TSRMLS_CC); jsValue = v8js_hash_to_jsobj(value, isolate);
break; break;
case IS_STRING: case IS_STRING:
@ -186,7 +186,7 @@ v8::Local<v8::Value> zval_to_v8js(zval *value, v8::Isolate *isolate) /* {{{ */
} }
/* }}} */ /* }}} */
int v8js_to_zval(v8::Local<v8::Value> jsValue, zval *return_value, int flags, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ int v8js_to_zval(v8::Local<v8::Value> jsValue, zval *return_value, int flags, v8::Isolate *isolate) /* {{{ */
{ {
if (jsValue->IsString()) if (jsValue->IsString())
{ {
@ -231,8 +231,8 @@ int v8js_to_zval(v8::Local<v8::Value> jsValue, zval *return_value, int flags, v8
} }
zend_class_entry *ce = php_date_get_date_ce(); zend_class_entry *ce = php_date_get_date_ce();
php_date_instantiate(ce, return_value TSRMLS_CC); php_date_instantiate(ce, return_value);
if (!php_date_initialize(Z_PHPDATE_P(return_value), date_str, strlen(date_str), NULL, NULL, 0 TSRMLS_CC)) { if (!php_date_initialize(Z_PHPDATE_P(return_value), date_str, strlen(date_str), NULL, NULL, 0)) {
efree(date_str); efree(date_str);
return FAILURE; return FAILURE;
} }
@ -254,9 +254,9 @@ int v8js_to_zval(v8::Local<v8::Value> jsValue, zval *return_value, int flags, v8
if ((flags & V8JS_FLAG_FORCE_ARRAY && !jsValue->IsFunction()) || jsValue->IsArray()) { if ((flags & V8JS_FLAG_FORCE_ARRAY && !jsValue->IsFunction()) || jsValue->IsArray()) {
array_init(return_value); array_init(return_value);
return v8js_get_properties_hash(jsValue, Z_ARRVAL_P(return_value), flags, isolate TSRMLS_CC); return v8js_get_properties_hash(jsValue, Z_ARRVAL_P(return_value), flags, isolate);
} else { } else {
v8js_v8object_create(return_value, jsValue, flags, isolate TSRMLS_CC); v8js_v8object_create(return_value, jsValue, flags, isolate);
return SUCCESS; return SUCCESS;
} }
} }

View File

@ -37,7 +37,7 @@ zend_class_entry *php_ce_v8js_memory_limit_exception;
/* {{{ Class: V8JsScriptException */ /* {{{ Class: V8JsScriptException */
void v8js_create_script_exception(zval *return_value, v8::Isolate *isolate, v8::TryCatch *try_catch TSRMLS_DC) /* {{{ */ void v8js_create_script_exception(zval *return_value, v8::Isolate *isolate, v8::TryCatch *try_catch) /* {{{ */
{ {
v8::String::Utf8Value exception(try_catch->Exception()); v8::String::Utf8Value exception(try_catch->Exception());
const char *exception_string = ToCString(exception); const char *exception_string = ToCString(exception);
@ -49,7 +49,7 @@ void v8js_create_script_exception(zval *return_value, v8::Isolate *isolate, v8::
object_init_ex(return_value, php_ce_v8js_script_exception); object_init_ex(return_value, php_ce_v8js_script_exception);
#define PHPV8_EXPROP(type, name, value) \ #define PHPV8_EXPROP(type, name, value) \
zend_update_property##type(php_ce_v8js_script_exception, return_value, #name, sizeof(#name) - 1, value TSRMLS_CC); zend_update_property##type(php_ce_v8js_script_exception, return_value, #name, sizeof(#name) - 1, value);
if (tc_message.IsEmpty()) { if (tc_message.IsEmpty()) {
spprintf(&message_string, 0, "%s", exception_string); spprintf(&message_string, 0, "%s", exception_string);
@ -85,7 +85,7 @@ void v8js_create_script_exception(zval *return_value, v8::Isolate *isolate, v8::
zend_object *php_exception = reinterpret_cast<zend_object *>(try_catch->Exception()->ToObject()->GetAlignedPointerFromInternalField(1)); zend_object *php_exception = reinterpret_cast<zend_object *>(try_catch->Exception()->ToObject()->GetAlignedPointerFromInternalField(1));
zend_class_entry *exception_ce = zend_exception_get_default(TSRMLS_C); zend_class_entry *exception_ce = zend_exception_get_default(TSRMLS_C);
if (instanceof_function(php_exception->ce, exception_ce TSRMLS_CC)) { if (instanceof_function(php_exception->ce, exception_ce)) {
++GC_REFCOUNT(php_exception); ++GC_REFCOUNT(php_exception);
zend_exception_set_previous(Z_OBJ_P(return_value), php_exception); zend_exception_set_previous(Z_OBJ_P(return_value), php_exception);
} }
@ -98,17 +98,17 @@ void v8js_create_script_exception(zval *return_value, v8::Isolate *isolate, v8::
} }
/* }}} */ /* }}} */
void v8js_throw_script_exception(v8::Isolate *isolate, v8::TryCatch *try_catch TSRMLS_DC) /* {{{ */ void v8js_throw_script_exception(v8::Isolate *isolate, v8::TryCatch *try_catch) /* {{{ */
{ {
v8::String::Utf8Value exception(try_catch->Exception()); v8::String::Utf8Value exception(try_catch->Exception());
const char *exception_string = ToCString(exception); const char *exception_string = ToCString(exception);
zval zexception; zval zexception;
if (try_catch->Message().IsEmpty()) { if (try_catch->Message().IsEmpty()) {
zend_throw_exception(php_ce_v8js_script_exception, (char *) exception_string, 0 TSRMLS_CC); zend_throw_exception(php_ce_v8js_script_exception, (char *) exception_string, 0);
} else { } else {
v8js_create_script_exception(&zexception, isolate, try_catch TSRMLS_CC); v8js_create_script_exception(&zexception, isolate, try_catch);
zend_throw_exception_object(&zexception TSRMLS_CC); zend_throw_exception_object(&zexception);
} }
} }
/* }}} */ /* }}} */
@ -121,7 +121,7 @@ void v8js_throw_script_exception(v8::Isolate *isolate, v8::TryCatch *try_catch T
if (zend_parse_parameters_none() == FAILURE) { \ if (zend_parse_parameters_none() == FAILURE) { \
return; \ return; \
} \ } \
value = zend_read_property(php_ce_v8js_script_exception, getThis(), #property, sizeof(#property) - 1, 0, &rv TSRMLS_CC); \ value = zend_read_property(php_ce_v8js_script_exception, getThis(), #property, sizeof(#property) - 1, 0, &rv); \
RETURN_ZVAL(value, 1, 0); \ RETURN_ZVAL(value, 1, 0); \
} }
@ -213,29 +213,29 @@ PHP_MINIT_FUNCTION(v8js_exceptions) /* {{{ */
/* V8JsException Class */ /* V8JsException Class */
INIT_CLASS_ENTRY(ce, "V8JsException", v8js_exception_methods); INIT_CLASS_ENTRY(ce, "V8JsException", v8js_exception_methods);
php_ce_v8js_exception = zend_register_internal_class_ex(&ce, spl_ce_RuntimeException TSRMLS_CC); php_ce_v8js_exception = zend_register_internal_class_ex(&ce, spl_ce_RuntimeException);
/* V8JsScriptException Class */ /* V8JsScriptException Class */
INIT_CLASS_ENTRY(ce, "V8JsScriptException", v8js_script_exception_methods); INIT_CLASS_ENTRY(ce, "V8JsScriptException", v8js_script_exception_methods);
php_ce_v8js_script_exception = zend_register_internal_class_ex(&ce, php_ce_v8js_exception TSRMLS_CC); php_ce_v8js_script_exception = zend_register_internal_class_ex(&ce, php_ce_v8js_exception);
php_ce_v8js_script_exception->ce_flags |= ZEND_ACC_FINAL; php_ce_v8js_script_exception->ce_flags |= ZEND_ACC_FINAL;
/* Add custom JS specific properties */ /* Add custom JS specific properties */
zend_declare_property_null(php_ce_v8js_script_exception, ZEND_STRL("JsFileName"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(php_ce_v8js_script_exception, ZEND_STRL("JsFileName"), ZEND_ACC_PROTECTED);
zend_declare_property_null(php_ce_v8js_script_exception, ZEND_STRL("JsLineNumber"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(php_ce_v8js_script_exception, ZEND_STRL("JsLineNumber"), ZEND_ACC_PROTECTED);
zend_declare_property_null(php_ce_v8js_script_exception, ZEND_STRL("JsStartColumn"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(php_ce_v8js_script_exception, ZEND_STRL("JsStartColumn"), ZEND_ACC_PROTECTED);
zend_declare_property_null(php_ce_v8js_script_exception, ZEND_STRL("JsEndColumn"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(php_ce_v8js_script_exception, ZEND_STRL("JsEndColumn"), ZEND_ACC_PROTECTED);
zend_declare_property_null(php_ce_v8js_script_exception, ZEND_STRL("JsSourceLine"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(php_ce_v8js_script_exception, ZEND_STRL("JsSourceLine"), ZEND_ACC_PROTECTED);
zend_declare_property_null(php_ce_v8js_script_exception, ZEND_STRL("JsTrace"), ZEND_ACC_PROTECTED TSRMLS_CC); zend_declare_property_null(php_ce_v8js_script_exception, ZEND_STRL("JsTrace"), ZEND_ACC_PROTECTED);
/* V8JsTimeLimitException Class */ /* V8JsTimeLimitException Class */
INIT_CLASS_ENTRY(ce, "V8JsTimeLimitException", v8js_time_limit_exception_methods); INIT_CLASS_ENTRY(ce, "V8JsTimeLimitException", v8js_time_limit_exception_methods);
php_ce_v8js_time_limit_exception = zend_register_internal_class_ex(&ce, php_ce_v8js_exception TSRMLS_CC); php_ce_v8js_time_limit_exception = zend_register_internal_class_ex(&ce, php_ce_v8js_exception);
php_ce_v8js_time_limit_exception->ce_flags |= ZEND_ACC_FINAL; php_ce_v8js_time_limit_exception->ce_flags |= ZEND_ACC_FINAL;
/* V8JsMemoryLimitException Class */ /* V8JsMemoryLimitException Class */
INIT_CLASS_ENTRY(ce, "V8JsMemoryLimitException", v8js_memory_limit_exception_methods); INIT_CLASS_ENTRY(ce, "V8JsMemoryLimitException", v8js_memory_limit_exception_methods);
php_ce_v8js_memory_limit_exception = zend_register_internal_class_ex(&ce, php_ce_v8js_exception TSRMLS_CC); php_ce_v8js_memory_limit_exception = zend_register_internal_class_ex(&ce, php_ce_v8js_exception);
php_ce_v8js_memory_limit_exception->ce_flags |= ZEND_ACC_FINAL; php_ce_v8js_memory_limit_exception->ce_flags |= ZEND_ACC_FINAL;
return SUCCESS; return SUCCESS;

View File

@ -20,8 +20,8 @@ extern zend_class_entry *php_ce_v8js_script_exception;
extern zend_class_entry *php_ce_v8js_time_limit_exception; extern zend_class_entry *php_ce_v8js_time_limit_exception;
extern zend_class_entry *php_ce_v8js_memory_limit_exception; extern zend_class_entry *php_ce_v8js_memory_limit_exception;
void v8js_create_script_exception(zval *return_value, v8::Isolate *isolate, v8::TryCatch *try_catch TSRMLS_DC); void v8js_create_script_exception(zval *return_value, v8::Isolate *isolate, v8::TryCatch *try_catch);
void v8js_throw_script_exception(v8::Isolate *isolate, v8::TryCatch *try_catch TSRMLS_DC); void v8js_throw_script_exception(v8::Isolate *isolate, v8::TryCatch *try_catch);
PHP_MINIT_FUNCTION(v8js_exceptions); PHP_MINIT_FUNCTION(v8js_exceptions);

View File

@ -55,7 +55,7 @@ V8JS_METHOD(print) /* {{{ */
} }
/* }}} */ /* }}} */
static void v8js_dumper(v8::Isolate *isolate, v8::Local<v8::Value> var, int level TSRMLS_DC) /* {{{ */ static void v8js_dumper(v8::Isolate *isolate, v8::Local<v8::Value> var, int level) /* {{{ */
{ {
if (level > 1) { if (level > 1) {
php_printf("%*c", (level - 1) * 2, ' '); php_printf("%*c", (level - 1) * 2, ' ');
@ -135,7 +135,7 @@ static void v8js_dumper(v8::Isolate *isolate, v8::Local<v8::Value> var, int leve
for (unsigned i = 0; i < length; i++) { for (unsigned i = 0; i < length; i++) {
php_printf("%*c[%d] =>\n", level * 2, ' ', i); php_printf("%*c[%d] =>\n", level * 2, ' ', i);
v8js_dumper(isolate, array->Get(i), level + 1 TSRMLS_CC); v8js_dumper(isolate, array->Get(i), level + 1);
} }
if (level > 1) { if (level > 1) {
@ -172,7 +172,7 @@ static void v8js_dumper(v8::Isolate *isolate, v8::Local<v8::Value> var, int leve
v8::Local<v8::String> key = keys->Get(i)->ToString(); v8::Local<v8::String> key = keys->Get(i)->ToString();
v8::String::Utf8Value kname(key); v8::String::Utf8Value kname(key);
php_printf("%*c[\"%s\"] =>\n", level * 2, ' ', ToCString(kname)); php_printf("%*c[\"%s\"] =>\n", level * 2, ' ', ToCString(kname));
v8js_dumper(isolate, object->Get(key), level + 1 TSRMLS_CC); v8js_dumper(isolate, object->Get(key), level + 1);
} }
} }
@ -196,7 +196,7 @@ V8JS_METHOD(var_dump) /* {{{ */
V8JS_TSRMLS_FETCH(); V8JS_TSRMLS_FETCH();
for (int i = 0; i < info.Length(); i++) { for (int i = 0; i < info.Length(); i++) {
v8js_dumper(isolate, info[i], 1 TSRMLS_CC); v8js_dumper(isolate, info[i], 1);
} }
info.GetReturnValue().Set(V8JS_NULL); info.GetReturnValue().Set(V8JS_NULL);
@ -244,7 +244,7 @@ V8JS_METHOD(require)
ZVAL_STRING(&params[1], module_id); ZVAL_STRING(&params[1], module_id);
call_result = call_user_function_ex(EG(function_table), NULL, &c->module_normaliser, call_result = call_user_function_ex(EG(function_table), NULL, &c->module_normaliser,
&normaliser_result, 2, params, 0, NULL TSRMLS_CC); &normaliser_result, 2, params, 0, NULL);
} }
isolate->Enter(); isolate->Enter();
@ -360,7 +360,7 @@ V8JS_METHOD(require)
zend_try { zend_try {
ZVAL_STRING(&params[0], normalised_module_id); ZVAL_STRING(&params[0], normalised_module_id);
call_result = call_user_function_ex(EG(function_table), NULL, &c->module_loader, &module_code, 1, params, 0, NULL TSRMLS_CC); call_result = call_user_function_ex(EG(function_table), NULL, &c->module_loader, &module_code, 1, params, 0, NULL);
} }
zend_catch { zend_catch {
v8js_terminate_execution(isolate); v8js_terminate_execution(isolate);

View File

@ -35,7 +35,7 @@ extern "C" {
static void v8js_weak_object_callback(const v8::WeakCallbackInfo<zend_object> &data); static void v8js_weak_object_callback(const v8::WeakCallbackInfo<zend_object> &data);
/* Callback for PHP methods and functions */ /* Callback for PHP methods and functions */
static void v8js_call_php_func(zend_object *object, zend_function *method_ptr, v8::Isolate *isolate, const v8::FunctionCallbackInfo<v8::Value>& info TSRMLS_DC) /* {{{ */ static void v8js_call_php_func(zend_object *object, zend_function *method_ptr, v8::Isolate *isolate, const v8::FunctionCallbackInfo<v8::Value>& info) /* {{{ */
{ {
v8::Local<v8::Value> return_value = V8JS_NULL; v8::Local<v8::Value> return_value = V8JS_NULL;
zend_fcall_info fci; zend_fcall_info fci;
@ -106,7 +106,7 @@ static void v8js_call_php_func(zend_object *object, zend_function *method_ptr, v
ZVAL_OBJ(&fci.params[i], object); ZVAL_OBJ(&fci.params[i], object);
Z_ADDREF_P(&fci.params[i]); Z_ADDREF_P(&fci.params[i]);
} else { } else {
if (v8js_to_zval(info[i], &fci.params[i], ctx->flags, isolate TSRMLS_CC) == FAILURE) { if (v8js_to_zval(info[i], &fci.params[i], ctx->flags, isolate) == FAILURE) {
error_len = spprintf(&error, 0, "converting parameter #%d passed to %s() failed", i + 1, method_ptr->common.function_name); error_len = spprintf(&error, 0, "converting parameter #%d passed to %s() failed", i + 1, method_ptr->common.function_name);
if (error_len > std::numeric_limits<int>::max()) { if (error_len > std::numeric_limits<int>::max()) {
@ -143,7 +143,7 @@ static void v8js_call_php_func(zend_object *object, zend_function *method_ptr, v
fcc.called_scope = object->ce; fcc.called_scope = object->ce;
fcc.object = object; fcc.object = object;
zend_call_function(&fci, &fcc TSRMLS_CC); zend_call_function(&fci, &fcc);
} }
zend_catch { zend_catch {
v8js_terminate_execution(isolate); v8js_terminate_execution(isolate);
@ -166,7 +166,7 @@ failure:
if(ctx->flags & V8JS_FLAG_PROPAGATE_PHP_EXCEPTIONS) { if(ctx->flags & V8JS_FLAG_PROPAGATE_PHP_EXCEPTIONS) {
zval tmp_zv; zval tmp_zv;
ZVAL_OBJ(&tmp_zv, EG(exception)); ZVAL_OBJ(&tmp_zv, EG(exception));
return_value = isolate->ThrowException(zval_to_v8js(&tmp_zv, isolate TSRMLS_CC)); return_value = isolate->ThrowException(zval_to_v8js(&tmp_zv, isolate));
zend_clear_exception(TSRMLS_C); zend_clear_exception(TSRMLS_C);
} else { } else {
v8js_terminate_execution(isolate); v8js_terminate_execution(isolate);
@ -175,7 +175,7 @@ failure:
// special case: "return $this" // special case: "return $this"
return_value = info.Holder(); return_value = info.Holder();
} else { } else {
return_value = zval_to_v8js(&retval, isolate TSRMLS_CC); return_value = zval_to_v8js(&retval, isolate);
} }
zval_ptr_dtor(&retval); zval_ptr_dtor(&retval);
@ -199,10 +199,10 @@ void v8js_php_callback(const v8::FunctionCallbackInfo<v8::Value>& info) /* {{{ *
if (!info.Data().IsEmpty() && info.Data()->IsExternal()) { if (!info.Data().IsEmpty() && info.Data()->IsExternal()) {
method_ptr = static_cast<zend_function *>(v8::External::Cast(*info.Data())->Value()); method_ptr = static_cast<zend_function *>(v8::External::Cast(*info.Data())->Value());
} else { } else {
method_ptr = zend_get_closure_invoke_method(object TSRMLS_CC); method_ptr = zend_get_closure_invoke_method(object);
} }
return v8js_call_php_func(object, method_ptr, isolate, info TSRMLS_CC); return v8js_call_php_func(object, method_ptr, isolate, info);
} }
/* Callback for PHP constructor calls */ /* Callback for PHP constructor calls */
@ -257,7 +257,7 @@ static void v8js_construct_callback(const v8::FunctionCallbackInfo<v8::Value>& i
// Call __construct function // Call __construct function
if (ctor_ptr != NULL) { if (ctor_ptr != NULL) {
v8js_call_php_func(Z_OBJ(value), ctor_ptr, isolate, info TSRMLS_CC); v8js_call_php_func(Z_OBJ(value), ctor_ptr, isolate, info);
} }
} }
@ -438,7 +438,7 @@ static void v8js_invoke_callback(const v8::FunctionCallbackInfo<v8::Value>& info
v8::Local<v8::String> str = self->GetConstructorName()->ToString(); v8::Local<v8::String> str = self->GetConstructorName()->ToString();
v8::String::Utf8Value str_value(str); v8::String::Utf8Value str_value(str);
zend_string *constructor_name = zend_string_init(ToCString(str_value), str->Utf8Length(), 0); zend_string *constructor_name = zend_string_init(ToCString(str_value), str->Utf8Length(), 0);
zend_class_entry *ce = zend_lookup_class(constructor_name TSRMLS_CC); zend_class_entry *ce = zend_lookup_class(constructor_name);
zend_string_release(constructor_name); zend_string_release(constructor_name);
v8::Local<v8::FunctionTemplate> new_tpl; v8::Local<v8::FunctionTemplate> new_tpl;
@ -535,7 +535,7 @@ static void v8js_fake_call_impl(const v8::FunctionCallbackInfo<v8::Value>& info)
// okay, look up the method name and manually invoke it. // okay, look up the method name and manually invoke it.
const zend_object_handlers *h = object->handlers; const zend_object_handlers *h = object->handlers;
zend_function *method_ptr = h->get_method(&object, method_name, NULL TSRMLS_CC); zend_function *method_ptr = h->get_method(&object, method_name, NULL);
zend_string_release(method_name); zend_string_release(method_name);
if (method_ptr == NULL || if (method_ptr == NULL ||
@ -687,12 +687,12 @@ v8::Local<v8::Value> v8js_named_property_callback(v8::Local<v8::String> property
if (callback_type == V8JS_PROP_GETTER) { if (callback_type == V8JS_PROP_GETTER) {
/* Nope, not a method -- must be a (case-sensitive) property */ /* Nope, not a method -- must be a (case-sensitive) property */
zend_property_info *property_info = zend_get_property_info(ce, Z_STR(zname), 1 TSRMLS_CC); zend_property_info *property_info = zend_get_property_info(ce, Z_STR(zname), 1);
if(!property_info || if(!property_info ||
(property_info != ZEND_WRONG_PROPERTY_INFO && (property_info != ZEND_WRONG_PROPERTY_INFO &&
property_info->flags & ZEND_ACC_PUBLIC)) { property_info->flags & ZEND_ACC_PUBLIC)) {
zval *property_val = zend_read_property(NULL, &zobject, name, name_len, true, &php_value TSRMLS_CC); zval *property_val = zend_read_property(NULL, &zobject, name, name_len, true, &php_value);
// special case uninitialized_zval_ptr and return an empty value // special case uninitialized_zval_ptr and return an empty value
// (indicating that we don't intercept this property) if the // (indicating that we don't intercept this property) if the
// property doesn't exist. // property doesn't exist.
@ -700,7 +700,7 @@ v8::Local<v8::Value> v8js_named_property_callback(v8::Local<v8::String> property
ret_value = v8::Local<v8::Value>(); ret_value = v8::Local<v8::Value>();
} else { } else {
// wrap it // wrap it
ret_value = zval_to_v8js(property_val, isolate TSRMLS_CC); ret_value = zval_to_v8js(property_val, isolate);
/* We don't own the reference to php_value... unless the /* We don't own the reference to php_value... unless the
* returned refcount was 0, in which case the below code * returned refcount was 0, in which case the below code
* will free it. */ * will free it. */
@ -713,21 +713,21 @@ v8::Local<v8::Value> v8js_named_property_callback(v8::Local<v8::String> property
&& ((ce->__get->common.fn_flags & ZEND_ACC_PUBLIC) != 0)) { && ((ce->__get->common.fn_flags & ZEND_ACC_PUBLIC) != 0)) {
/* Okay, let's call __get. */ /* Okay, let's call __get. */
zend_call_method_with_1_params(&zobject, ce, &ce->__get, ZEND_GET_FUNC_NAME, &php_value, &zname); zend_call_method_with_1_params(&zobject, ce, &ce->__get, ZEND_GET_FUNC_NAME, &php_value, &zname);
ret_value = zval_to_v8js(&php_value, isolate TSRMLS_CC); ret_value = zval_to_v8js(&php_value, isolate);
zval_ptr_dtor(&php_value); zval_ptr_dtor(&php_value);
} }
} else if (callback_type == V8JS_PROP_SETTER) { } else if (callback_type == V8JS_PROP_SETTER) {
if (v8js_to_zval(set_value, &php_value, ctx->flags, isolate TSRMLS_CC) != SUCCESS) { if (v8js_to_zval(set_value, &php_value, ctx->flags, isolate) != SUCCESS) {
ret_value = v8::Local<v8::Value>(); ret_value = v8::Local<v8::Value>();
} }
else { else {
zend_property_info *property_info = zend_get_property_info(ce, Z_STR(zname), 1 TSRMLS_CC); zend_property_info *property_info = zend_get_property_info(ce, Z_STR(zname), 1);
if(!property_info || if(!property_info ||
(property_info != ZEND_WRONG_PROPERTY_INFO && (property_info != ZEND_WRONG_PROPERTY_INFO &&
property_info->flags & ZEND_ACC_PUBLIC)) { property_info->flags & ZEND_ACC_PUBLIC)) {
zend_update_property(scope, &zobject, name, name_len, &php_value TSRMLS_CC); zend_update_property(scope, &zobject, name, name_len, &php_value);
ret_value = set_value; ret_value = set_value;
} }
else if (ce->__set else if (ce->__set
@ -736,7 +736,7 @@ v8::Local<v8::Value> v8js_named_property_callback(v8::Local<v8::String> property
/* Okay, let's call __set. */ /* Okay, let's call __set. */
zval php_ret_value; zval php_ret_value;
zend_call_method_with_2_params(&zobject, ce, &ce->__set, ZEND_SET_FUNC_NAME, &php_ret_value, &zname, &php_value); zend_call_method_with_2_params(&zobject, ce, &ce->__set, ZEND_SET_FUNC_NAME, &php_ret_value, &zname, &php_value);
ret_value = zval_to_v8js(&php_ret_value, isolate TSRMLS_CC); ret_value = zval_to_v8js(&php_ret_value, isolate);
zval_ptr_dtor(&php_ret_value); zval_ptr_dtor(&php_ret_value);
} }
} }
@ -749,18 +749,18 @@ v8::Local<v8::Value> v8js_named_property_callback(v8::Local<v8::String> property
const zend_object_handlers *h = object->handlers; const zend_object_handlers *h = object->handlers;
if (callback_type == V8JS_PROP_QUERY) { if (callback_type == V8JS_PROP_QUERY) {
if (h->has_property(&zobject, &zname, 0, NULL TSRMLS_CC)) { if (h->has_property(&zobject, &zname, 0, NULL)) {
ret_value = V8JS_UINT(v8::None); ret_value = V8JS_UINT(v8::None);
} else { } else {
ret_value = v8::Local<v8::Value>(); // empty handle ret_value = v8::Local<v8::Value>(); // empty handle
} }
} else { } else {
zend_property_info *property_info = zend_get_property_info(ce, Z_STR(zname), 1 TSRMLS_CC); zend_property_info *property_info = zend_get_property_info(ce, Z_STR(zname), 1);
if(!property_info || if(!property_info ||
(property_info != ZEND_WRONG_PROPERTY_INFO && (property_info != ZEND_WRONG_PROPERTY_INFO &&
property_info->flags & ZEND_ACC_PUBLIC)) { property_info->flags & ZEND_ACC_PUBLIC)) {
h->unset_property(&zobject, &zname, NULL TSRMLS_CC); h->unset_property(&zobject, &zname, NULL);
ret_value = V8JS_TRUE(); ret_value = V8JS_TRUE();
} }
else { else {
@ -813,7 +813,7 @@ static void v8js_named_property_deleter(v8::Local<v8::String> property, const v8
static v8::Local<v8::Object> v8js_wrap_object(v8::Isolate *isolate, zend_class_entry *ce, zval *value TSRMLS_DC) /* {{{ */ static v8::Local<v8::Object> v8js_wrap_object(v8::Isolate *isolate, zend_class_entry *ce, zval *value) /* {{{ */
{ {
v8js_ctx *ctx = (v8js_ctx *) isolate->GetData(0); v8js_ctx *ctx = (v8js_ctx *) isolate->GetData(0);
v8::Local<v8::FunctionTemplate> new_tpl; v8::Local<v8::FunctionTemplate> new_tpl;
@ -925,7 +925,7 @@ static v8::Local<v8::Object> v8js_wrap_object(v8::Isolate *isolate, zend_class_e
/* }}} */ /* }}} */
static v8::Local<v8::Object> v8js_wrap_array_to_object(v8::Isolate *isolate, zval *value TSRMLS_DC) /* {{{ */ static v8::Local<v8::Object> v8js_wrap_array_to_object(v8::Isolate *isolate, zval *value) /* {{{ */
{ {
int i; int i;
zend_string *key; zend_string *key;
@ -1003,7 +1003,7 @@ static v8::Local<v8::Object> v8js_wrap_array_to_object(v8::Isolate *isolate, zva
/* }}} */ /* }}} */
v8::Local<v8::Value> v8js_hash_to_jsobj(zval *value, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ v8::Local<v8::Value> v8js_hash_to_jsobj(zval *value, v8::Isolate *isolate) /* {{{ */
{ {
HashTable *myht; HashTable *myht;
zend_class_entry *ce = NULL; zend_class_entry *ce = NULL;
@ -1025,7 +1025,7 @@ v8::Local<v8::Value> v8js_hash_to_jsobj(zval *value, v8::Isolate *isolate TSRMLS
v8js_v8object *c = Z_V8JS_V8OBJECT_OBJ_P(value); v8js_v8object *c = Z_V8JS_V8OBJECT_OBJ_P(value);
if(isolate != c->ctx->isolate) { if(isolate != c->ctx->isolate) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "V8Function object passed to wrong V8Js instance"); php_error_docref(NULL, E_WARNING, "V8Function object passed to wrong V8Js instance");
return V8JS_NULL; return V8JS_NULL;
} }
@ -1034,7 +1034,7 @@ v8::Local<v8::Value> v8js_hash_to_jsobj(zval *value, v8::Isolate *isolate TSRMLS
/* If it's a PHP object, wrap it */ /* If it's a PHP object, wrap it */
if (ce) { if (ce) {
v8::Local<v8::Value> wrapped_object = v8js_wrap_object(isolate, ce, value TSRMLS_CC); v8::Local<v8::Value> wrapped_object = v8js_wrap_object(isolate, ce, value);
if (ce == zend_ce_generator) { if (ce == zend_ce_generator) {
/* Wrap PHP Generator object in a wrapper function that provides /* Wrap PHP Generator object in a wrapper function that provides
@ -1047,7 +1047,7 @@ v8::Local<v8::Value> v8js_hash_to_jsobj(zval *value, v8::Isolate *isolate TSRMLS
/* Associative PHP arrays cannot be wrapped to JS arrays, convert them to /* Associative PHP arrays cannot be wrapped to JS arrays, convert them to
* JS objects and attach all their array keys as properties. */ * JS objects and attach all their array keys as properties. */
return v8js_wrap_array_to_object(isolate, value TSRMLS_CC); return v8js_wrap_array_to_object(isolate, value);
} }
/* }}} */ /* }}} */

View File

@ -14,7 +14,7 @@
#ifndef V8JS_OBJECT_EXPORT_H #ifndef V8JS_OBJECT_EXPORT_H
#define V8JS_OBJECT_EXPORT_H #define V8JS_OBJECT_EXPORT_H
v8::Local<v8::Value> v8js_hash_to_jsobj(zval *value, v8::Isolate *isolate TSRMLS_DC); v8::Local<v8::Value> v8js_hash_to_jsobj(zval *value, v8::Isolate *isolate);
typedef enum { typedef enum {

View File

@ -124,7 +124,7 @@ void v8js_timer_thread(zend_v8js_globals *globals) /* {{{ */
/* }}} */ /* }}} */
void v8js_timer_push(long time_limit, long memory_limit, v8js_ctx *c TSRMLS_DC) /* {{{ */ void v8js_timer_push(long time_limit, long memory_limit, v8js_ctx *c) /* {{{ */
{ {
V8JSG(timer_mutex).lock(); V8JSG(timer_mutex).lock();

View File

@ -25,7 +25,7 @@ struct v8js_timer_ctx
}; };
void v8js_timer_thread(zend_v8js_globals *globals); void v8js_timer_thread(zend_v8js_globals *globals);
void v8js_timer_push(long time_limit, long memory_limit, v8js_ctx *c TSRMLS_DC); void v8js_timer_push(long time_limit, long memory_limit, v8js_ctx *c);
#endif /* V8JS_TIMER_H */ #endif /* V8JS_TIMER_H */

View File

@ -96,7 +96,7 @@ void v8js_v8_init(TSRMLS_D) /* {{{ */
*/ */
void v8js_v8_call(v8js_ctx *c, zval **return_value, void v8js_v8_call(v8js_ctx *c, zval **return_value,
long flags, long time_limit, long memory_limit, long flags, long time_limit, long memory_limit,
std::function< v8::Local<v8::Value>(v8::Isolate *) >& v8_call TSRMLS_DC) /* {{{ */ std::function< v8::Local<v8::Value>(v8::Isolate *) >& v8_call) /* {{{ */
{ {
char *tz = NULL; char *tz = NULL;
@ -138,7 +138,7 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value,
/* Always pass the timer to the stack so there can be follow-up changes to /* Always pass the timer to the stack so there can be follow-up changes to
* the time & memory limit. */ * the time & memory limit. */
v8js_timer_push(time_limit, memory_limit, c TSRMLS_CC); v8js_timer_push(time_limit, memory_limit, c);
/* Execute script */ /* Execute script */
c->in_execution++; c->in_execution++;
@ -163,7 +163,7 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value,
if (c->time_limit_hit) { if (c->time_limit_hit) {
// Execution has been terminated due to time limit // Execution has been terminated due to time limit
sprintf(exception_string, "Script time limit of %lu milliseconds exceeded", time_limit); sprintf(exception_string, "Script time limit of %lu milliseconds exceeded", time_limit);
zend_throw_exception(php_ce_v8js_time_limit_exception, exception_string, 0 TSRMLS_CC); zend_throw_exception(php_ce_v8js_time_limit_exception, exception_string, 0);
return; return;
} }
@ -185,7 +185,7 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value,
if (c->memory_limit_hit) { if (c->memory_limit_hit) {
// Execution has been terminated due to memory limit // Execution has been terminated due to memory limit
sprintf(exception_string, "Script memory limit of %lu bytes exceeded", memory_limit); sprintf(exception_string, "Script memory limit of %lu bytes exceeded", memory_limit);
zend_throw_exception(php_ce_v8js_memory_limit_exception, exception_string, 0 TSRMLS_CC); zend_throw_exception(php_ce_v8js_memory_limit_exception, exception_string, 0);
return; return;
} }
@ -196,7 +196,7 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value,
/* There was pending exception left from earlier executions -> throw to PHP */ /* There was pending exception left from earlier executions -> throw to PHP */
if (Z_TYPE(c->pending_exception) == IS_OBJECT) { if (Z_TYPE(c->pending_exception) == IS_OBJECT) {
zend_throw_exception_object(&c->pending_exception TSRMLS_CC); zend_throw_exception_object(&c->pending_exception);
ZVAL_NULL(&c->pending_exception); ZVAL_NULL(&c->pending_exception);
} }
@ -208,13 +208,13 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value,
/* Report immediately if report_uncaught is true */ /* Report immediately if report_uncaught is true */
if (c->report_uncaught) { if (c->report_uncaught) {
v8js_throw_script_exception(c->isolate, &try_catch TSRMLS_CC); v8js_throw_script_exception(c->isolate, &try_catch);
return; return;
} }
/* Exception thrown from JS, preserve it for future execution */ /* Exception thrown from JS, preserve it for future execution */
if (result.IsEmpty()) { if (result.IsEmpty()) {
v8js_create_script_exception(&c->pending_exception, c->isolate, &try_catch TSRMLS_CC); v8js_create_script_exception(&c->pending_exception, c->isolate, &try_catch);
return; return;
} }
} }
@ -226,7 +226,7 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value,
/* Convert V8 value to PHP value */ /* Convert V8 value to PHP value */
if (return_value && !result.IsEmpty()) { if (return_value && !result.IsEmpty()) {
v8js_to_zval(result, *return_value, flags, c->isolate TSRMLS_CC); v8js_to_zval(result, *return_value, flags, c->isolate);
} }
} }
} }
@ -258,7 +258,7 @@ void v8js_terminate_execution(v8::Isolate *isolate) /* {{{ */
/* }}} */ /* }}} */
int v8js_get_properties_hash(v8::Local<v8::Value> jsValue, HashTable *retval, int flags, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ int v8js_get_properties_hash(v8::Local<v8::Value> jsValue, HashTable *retval, int flags, v8::Isolate *isolate) /* {{{ */
{ {
v8::Local<v8::Object> jsObj = jsValue->ToObject(); v8::Local<v8::Object> jsObj = jsValue->ToObject();
@ -288,7 +288,7 @@ int v8js_get_properties_hash(v8::Local<v8::Value> jsValue, HashTable *retval, in
Z_ADDREF_P(&value); Z_ADDREF_P(&value);
} }
else { else {
if (v8js_to_zval(jsVal, &value, flags, isolate TSRMLS_CC) == FAILURE) { if (v8js_to_zval(jsVal, &value, flags, isolate) == FAILURE) {
zval_ptr_dtor(&value); zval_ptr_dtor(&value);
return FAILURE; return FAILURE;
} }

View File

@ -54,11 +54,11 @@ static inline const char * ToCString(const v8::String::Utf8Value &value) /* {{{
void v8js_v8_init(TSRMLS_D); void v8js_v8_init(TSRMLS_D);
void v8js_v8_call(v8js_ctx *c, zval **return_value, void v8js_v8_call(v8js_ctx *c, zval **return_value,
long flags, long time_limit, long memory_limit, long flags, long time_limit, long memory_limit,
std::function< v8::Local<v8::Value>(v8::Isolate *) >& v8_call TSRMLS_DC); std::function< v8::Local<v8::Value>(v8::Isolate *) >& v8_call);
void v8js_terminate_execution(v8::Isolate *isolate); void v8js_terminate_execution(v8::Isolate *isolate);
/* Fetch V8 object properties */ /* Fetch V8 object properties */
int v8js_get_properties_hash(v8::Local<v8::Value> jsValue, HashTable *retval, int flags, v8::Isolate *isolate TSRMLS_DC); int v8js_get_properties_hash(v8::Local<v8::Value> jsValue, HashTable *retval, int flags, v8::Isolate *isolate);
#define V8JS_CTX_PROLOGUE_EX(ctx, ret) \ #define V8JS_CTX_PROLOGUE_EX(ctx, ret) \
if (!V8JSG(v8_initialized)) { \ if (!V8JSG(v8_initialized)) { \

View File

@ -46,7 +46,7 @@ static zend_object_handlers v8js_v8generator_handlers;
/* V8 Object handlers */ /* V8 Object handlers */
static int v8js_v8object_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot TSRMLS_DC) /* {{{ */ static int v8js_v8object_has_property(zval *object, zval *member, int has_set_exists, void **cache_slot) /* {{{ */
{ {
/* param has_set_exists: /* param has_set_exists:
* 0 (has) whether property exists and is not NULL - isset() * 0 (has) whether property exists and is not NULL - isset()
@ -58,7 +58,7 @@ static int v8js_v8object_has_property(zval *object, zval *member, int has_set_ex
if (!obj->ctx) { if (!obj->ctx) {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"Can't access V8Object after V8Js instance is destroyed!", 0 TSRMLS_CC); "Can't access V8Object after V8Js instance is destroyed!", 0);
return retval; return retval;
} }
@ -115,14 +115,14 @@ static int v8js_v8object_has_property(zval *object, zval *member, int has_set_ex
} }
/* }}} */ /* }}} */
static zval *v8js_v8object_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv TSRMLS_DC) /* {{{ */ static zval *v8js_v8object_read_property(zval *object, zval *member, int type, void **cache_slot, zval *rv) /* {{{ */
{ {
zval *retval = rv; zval *retval = rv;
v8js_v8object *obj = Z_V8JS_V8OBJECT_OBJ_P(object); v8js_v8object *obj = Z_V8JS_V8OBJECT_OBJ_P(object);
if (!obj->ctx) { if (!obj->ctx) {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"Can't access V8Object after V8Js instance is destroyed!", 0 TSRMLS_CC); "Can't access V8Object after V8Js instance is destroyed!", 0);
return retval; return retval;
} }
@ -145,7 +145,7 @@ static zval *v8js_v8object_read_property(zval *object, zval *member, int type, v
if (jsObj->HasRealNamedProperty(jsKey) || jsObj->HasRealNamedCallbackProperty(jsKey)) { if (jsObj->HasRealNamedProperty(jsKey) || jsObj->HasRealNamedCallbackProperty(jsKey)) {
jsVal = jsObj->Get(jsKey); jsVal = jsObj->Get(jsKey);
if (v8js_to_zval(jsVal, retval, obj->flags, isolate TSRMLS_CC) == SUCCESS) { if (v8js_to_zval(jsVal, retval, obj->flags, isolate) == SUCCESS) {
return retval; return retval;
} }
} }
@ -155,13 +155,13 @@ static zval *v8js_v8object_read_property(zval *object, zval *member, int type, v
} }
/* }}} */ /* }}} */
static void v8js_v8object_write_property(zval *object, zval *member, zval *value, void **cache_slot TSRMLS_DC) /* {{{ */ static void v8js_v8object_write_property(zval *object, zval *member, zval *value, void **cache_slot ) /* {{{ */
{ {
v8js_v8object *obj = Z_V8JS_V8OBJECT_OBJ_P(object); v8js_v8object *obj = Z_V8JS_V8OBJECT_OBJ_P(object);
if (!obj->ctx) { if (!obj->ctx) {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"Can't access V8Object after V8Js instance is destroyed!", 0 TSRMLS_CC); "Can't access V8Object after V8Js instance is destroyed!", 0);
return; return;
} }
@ -180,13 +180,13 @@ static void v8js_v8object_write_property(zval *object, zval *member, zval *value
} }
/* }}} */ /* }}} */
static void v8js_v8object_unset_property(zval *object, zval *member, void **cache_slot TSRMLS_DC) /* {{{ */ static void v8js_v8object_unset_property(zval *object, zval *member, void **cache_slot) /* {{{ */
{ {
v8js_v8object *obj = Z_V8JS_V8OBJECT_OBJ_P(object); v8js_v8object *obj = Z_V8JS_V8OBJECT_OBJ_P(object);
if (!obj->ctx) { if (!obj->ctx) {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"Can't access V8Object after V8Js instance is destroyed!", 0 TSRMLS_CC); "Can't access V8Object after V8Js instance is destroyed!", 0);
return; return;
} }
@ -205,7 +205,7 @@ static void v8js_v8object_unset_property(zval *object, zval *member, void **cach
} }
/* }}} */ /* }}} */
static HashTable *v8js_v8object_get_properties(zval *object TSRMLS_DC) /* {{{ */ static HashTable *v8js_v8object_get_properties(zval *object) /* {{{ */
{ {
v8js_v8object *obj = Z_V8JS_V8OBJECT_OBJ_P(object); v8js_v8object *obj = Z_V8JS_V8OBJECT_OBJ_P(object);
@ -230,14 +230,14 @@ static HashTable *v8js_v8object_get_properties(zval *object TSRMLS_DC) /* {{{ */
if (!obj->ctx) { if (!obj->ctx) {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"Can't access V8Object after V8Js instance is destroyed!", 0 TSRMLS_CC); "Can't access V8Object after V8Js instance is destroyed!", 0);
return NULL; return NULL;
} }
V8JS_CTX_PROLOGUE_EX(obj->ctx, NULL); V8JS_CTX_PROLOGUE_EX(obj->ctx, NULL);
v8::Local<v8::Value> v8obj = v8::Local<v8::Value>::New(isolate, obj->v8obj); v8::Local<v8::Value> v8obj = v8::Local<v8::Value>::New(isolate, obj->v8obj);
if (v8js_get_properties_hash(v8obj, obj->properties, obj->flags, isolate TSRMLS_CC) == SUCCESS) { if (v8js_get_properties_hash(v8obj, obj->properties, obj->flags, isolate) == SUCCESS) {
return obj->properties; return obj->properties;
} }
@ -245,21 +245,21 @@ static HashTable *v8js_v8object_get_properties(zval *object TSRMLS_DC) /* {{{ */
} }
/* }}} */ /* }}} */
static HashTable *v8js_v8object_get_debug_info(zval *object, int *is_temp TSRMLS_DC) /* {{{ */ static HashTable *v8js_v8object_get_debug_info(zval *object, int *is_temp) /* {{{ */
{ {
*is_temp = 0; *is_temp = 0;
return v8js_v8object_get_properties(object TSRMLS_CC); return v8js_v8object_get_properties(object);
} }
/* }}} */ /* }}} */
static zend_function *v8js_v8object_get_method(zend_object **object_ptr, zend_string *method, const zval *key TSRMLS_DC) /* {{{ */ static zend_function *v8js_v8object_get_method(zend_object **object_ptr, zend_string *method, const zval *key) /* {{{ */
{ {
v8js_v8object *obj = v8js_v8object_fetch_object(*object_ptr); v8js_v8object *obj = v8js_v8object_fetch_object(*object_ptr);
zend_function *f; zend_function *f;
if (!obj->ctx) { if (!obj->ctx) {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"Can't access V8Object after V8Js instance is destroyed!", 0 TSRMLS_CC); "Can't access V8Object after V8Js instance is destroyed!", 0);
return NULL; return NULL;
} }
@ -297,7 +297,7 @@ static int v8js_v8object_call_method(zend_string *method, zend_object *object, I
if (!obj->ctx) { if (!obj->ctx) {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"Can't access V8Object after V8Js instance is destroyed!", 0 TSRMLS_CC); "Can't access V8Object after V8Js instance is destroyed!", 0);
return FAILURE; return FAILURE;
} }
@ -319,7 +319,7 @@ static int v8js_v8object_call_method(zend_string *method, zend_object *object, I
/* std::function relies on its dtor to be executed, otherwise it leaks /* std::function relies on its dtor to be executed, otherwise it leaks
* some memory on bailout. */ * some memory on bailout. */
{ {
std::function< v8::Local<v8::Value>(v8::Isolate *) > v8_call = [obj, method, argc, argv, object, &return_value TSRMLS_CC](v8::Isolate *isolate) { std::function< v8::Local<v8::Value>(v8::Isolate *) > v8_call = [obj, method, argc, argv, object, &return_value](v8::Isolate *isolate) {
int i = 0; int i = 0;
v8::Local<v8::String> method_name = V8JS_SYML(ZSTR_VAL(method), static_cast<int>(ZSTR_LEN(method))); v8::Local<v8::String> method_name = V8JS_SYML(ZSTR_VAL(method), static_cast<int>(ZSTR_LEN(method)));
@ -346,7 +346,7 @@ static int v8js_v8object_call_method(zend_string *method, zend_object *object, I
for (i = 0; i < argc; i++) { for (i = 0; i < argc; i++) {
new(&jsArgv[i]) v8::Local<v8::Value>; new(&jsArgv[i]) v8::Local<v8::Value>;
jsArgv[i] = v8::Local<v8::Value>::New(isolate, zval_to_v8js(&argv[i], isolate TSRMLS_CC)); jsArgv[i] = v8::Local<v8::Value>::New(isolate, zval_to_v8js(&argv[i], isolate));
} }
v8::Local<v8::Value> result = cb->Call(thisObj, argc, jsArgv); v8::Local<v8::Value> result = cb->Call(thisObj, argc, jsArgv);
@ -361,7 +361,7 @@ static int v8js_v8object_call_method(zend_string *method, zend_object *object, I
return result; return result;
}; };
v8js_v8_call(obj->ctx, &return_value, obj->flags, obj->ctx->time_limit, obj->ctx->memory_limit, v8_call TSRMLS_CC); v8js_v8_call(obj->ctx, &return_value, obj->flags, obj->ctx->time_limit, obj->ctx->memory_limit, v8_call);
} }
if (argc > 0) { if (argc > 0) {
@ -378,14 +378,14 @@ static int v8js_v8object_call_method(zend_string *method, zend_object *object, I
} }
/* }}} */ /* }}} */
static int v8js_v8object_get_closure(zval *object, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **zobj_ptr TSRMLS_DC) /* {{{ */ static int v8js_v8object_get_closure(zval *object, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **zobj_ptr) /* {{{ */
{ {
zend_function *invoke; zend_function *invoke;
v8js_v8object *obj = Z_V8JS_V8OBJECT_OBJ_P(object); v8js_v8object *obj = Z_V8JS_V8OBJECT_OBJ_P(object);
if (!obj->ctx) { if (!obj->ctx) {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"Can't access V8Object after V8Js instance is destroyed!", 0 TSRMLS_CC); "Can't access V8Object after V8Js instance is destroyed!", 0);
return FAILURE; return FAILURE;
} }
@ -412,7 +412,7 @@ static int v8js_v8object_get_closure(zval *object, zend_class_entry **ce_ptr, ze
} }
/* }}} */ /* }}} */
static void v8js_v8object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */ static void v8js_v8object_free_storage(zend_object *object) /* {{{ */
{ {
v8js_v8object *c = v8js_v8object_fetch_object(object); v8js_v8object *c = v8js_v8object_fetch_object(object);
@ -422,7 +422,7 @@ static void v8js_v8object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
c->properties = NULL; c->properties = NULL;
} }
zend_object_std_dtor(&c->std TSRMLS_CC); zend_object_std_dtor(&c->std);
if(c->ctx) { if(c->ctx) {
c->v8obj.Reset(); c->v8obj.Reset();
@ -431,12 +431,12 @@ static void v8js_v8object_free_storage(zend_object *object TSRMLS_DC) /* {{{ */
} }
/* }}} */ /* }}} */
static zend_object *v8js_v8object_new(zend_class_entry *ce TSRMLS_DC) /* {{{ */ static zend_object *v8js_v8object_new(zend_class_entry *ce) /* {{{ */
{ {
v8js_v8object *c; v8js_v8object *c;
c = (v8js_v8object *) ecalloc(1, sizeof(v8js_v8object) + zend_object_properties_size(ce)); c = (v8js_v8object *) ecalloc(1, sizeof(v8js_v8object) + zend_object_properties_size(ce));
zend_object_std_init(&c->std, ce TSRMLS_CC); zend_object_std_init(&c->std, ce);
c->std.handlers = &v8js_v8object_handlers; c->std.handlers = &v8js_v8object_handlers;
new(&c->v8obj) v8::Persistent<v8::Value>(); new(&c->v8obj) v8::Persistent<v8::Value>();
@ -454,7 +454,7 @@ static zend_object *v8js_v8object_new(zend_class_entry *ce TSRMLS_DC) /* {{{ */
PHP_METHOD(V8Object,__construct) PHP_METHOD(V8Object,__construct)
{ {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"Can't directly construct V8 objects!", 0 TSRMLS_CC); "Can't directly construct V8 objects!", 0);
RETURN_FALSE; RETURN_FALSE;
} }
/* }}} */ /* }}} */
@ -464,7 +464,7 @@ PHP_METHOD(V8Object,__construct)
PHP_METHOD(V8Object, __sleep) PHP_METHOD(V8Object, __sleep)
{ {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"You cannot serialize or unserialize V8Object instances", 0 TSRMLS_CC); "You cannot serialize or unserialize V8Object instances", 0);
RETURN_FALSE; RETURN_FALSE;
} }
/* }}} */ /* }}} */
@ -474,7 +474,7 @@ PHP_METHOD(V8Object, __sleep)
PHP_METHOD(V8Object, __wakeup) PHP_METHOD(V8Object, __wakeup)
{ {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"You cannot serialize or unserialize V8Object instances", 0 TSRMLS_CC); "You cannot serialize or unserialize V8Object instances", 0);
RETURN_FALSE; RETURN_FALSE;
} }
/* }}} */ /* }}} */
@ -484,7 +484,7 @@ PHP_METHOD(V8Object, __wakeup)
PHP_METHOD(V8Function,__construct) PHP_METHOD(V8Function,__construct)
{ {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"Can't directly construct V8 objects!", 0 TSRMLS_CC); "Can't directly construct V8 objects!", 0);
RETURN_FALSE; RETURN_FALSE;
} }
/* }}} */ /* }}} */
@ -494,7 +494,7 @@ PHP_METHOD(V8Function,__construct)
PHP_METHOD(V8Function, __sleep) PHP_METHOD(V8Function, __sleep)
{ {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"You cannot serialize or unserialize V8Function instances", 0 TSRMLS_CC); "You cannot serialize or unserialize V8Function instances", 0);
RETURN_FALSE; RETURN_FALSE;
} }
/* }}} */ /* }}} */
@ -504,7 +504,7 @@ PHP_METHOD(V8Function, __sleep)
PHP_METHOD(V8Function, __wakeup) PHP_METHOD(V8Function, __wakeup)
{ {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"You cannot serialize or unserialize V8Function instances", 0 TSRMLS_CC); "You cannot serialize or unserialize V8Function instances", 0);
RETURN_FALSE; RETURN_FALSE;
} }
/* }}} */ /* }}} */
@ -601,7 +601,7 @@ static zend_function *v8js_v8generator_get_method(zend_object **object_ptr, zend
PHP_METHOD(V8Generator,__construct) PHP_METHOD(V8Generator,__construct)
{ {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"Can't directly construct V8 objects!", 0 TSRMLS_CC); "Can't directly construct V8 objects!", 0);
RETURN_FALSE; RETURN_FALSE;
} }
/* }}} */ /* }}} */
@ -611,7 +611,7 @@ PHP_METHOD(V8Generator,__construct)
PHP_METHOD(V8Generator, __sleep) PHP_METHOD(V8Generator, __sleep)
{ {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"You cannot serialize or unserialize V8Generator instances", 0 TSRMLS_CC); "You cannot serialize or unserialize V8Generator instances", 0);
RETURN_FALSE; RETURN_FALSE;
} }
/* }}} */ /* }}} */
@ -621,7 +621,7 @@ PHP_METHOD(V8Generator, __sleep)
PHP_METHOD(V8Generator, __wakeup) PHP_METHOD(V8Generator, __wakeup)
{ {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"You cannot serialize or unserialize V8Generator instances", 0 TSRMLS_CC); "You cannot serialize or unserialize V8Generator instances", 0);
RETURN_FALSE; RETURN_FALSE;
} }
/* }}} */ /* }}} */
@ -665,7 +665,7 @@ PHP_METHOD(V8Generator, rewind)
if(g->primed) { if(g->primed) {
zend_throw_exception(php_ce_v8js_exception, zend_throw_exception(php_ce_v8js_exception,
"V8Generator::rewind not supported by ES6", 0 TSRMLS_CC); "V8Generator::rewind not supported by ES6", 0);
} }
@ -688,7 +688,7 @@ PHP_METHOD(V8Generator, valid)
/* }}} */ /* }}} */
void v8js_v8object_create(zval *res, v8::Local<v8::Value> value, int flags, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ void v8js_v8object_create(zval *res, v8::Local<v8::Value> value, int flags, v8::Isolate *isolate) /* {{{ */
{ {
v8js_ctx *ctx = (v8js_ctx *) isolate->GetData(0); v8js_ctx *ctx = (v8js_ctx *) isolate->GetData(0);
@ -766,19 +766,19 @@ PHP_MINIT_FUNCTION(v8js_v8object_class) /* {{{ */
/* V8Object Class */ /* V8Object Class */
INIT_CLASS_ENTRY(ce, "V8Object", v8js_v8object_methods); INIT_CLASS_ENTRY(ce, "V8Object", v8js_v8object_methods);
php_ce_v8object = zend_register_internal_class(&ce TSRMLS_CC); php_ce_v8object = zend_register_internal_class(&ce);
php_ce_v8object->ce_flags |= ZEND_ACC_FINAL; php_ce_v8object->ce_flags |= ZEND_ACC_FINAL;
php_ce_v8object->create_object = v8js_v8object_new; php_ce_v8object->create_object = v8js_v8object_new;
/* V8Function Class */ /* V8Function Class */
INIT_CLASS_ENTRY(ce, "V8Function", v8js_v8function_methods); INIT_CLASS_ENTRY(ce, "V8Function", v8js_v8function_methods);
php_ce_v8function = zend_register_internal_class(&ce TSRMLS_CC); php_ce_v8function = zend_register_internal_class(&ce);
php_ce_v8function->ce_flags |= ZEND_ACC_FINAL; php_ce_v8function->ce_flags |= ZEND_ACC_FINAL;
php_ce_v8function->create_object = v8js_v8object_new; php_ce_v8function->create_object = v8js_v8object_new;
/* V8Generator Class */ /* V8Generator Class */
INIT_CLASS_ENTRY(ce, "V8Generator", v8js_v8generator_methods); INIT_CLASS_ENTRY(ce, "V8Generator", v8js_v8generator_methods);
php_ce_v8generator = zend_register_internal_class(&ce TSRMLS_CC); php_ce_v8generator = zend_register_internal_class(&ce);
php_ce_v8generator->ce_flags |= ZEND_ACC_FINAL; php_ce_v8generator->ce_flags |= ZEND_ACC_FINAL;
php_ce_v8generator->create_object = v8js_v8generator_new; php_ce_v8generator->create_object = v8js_v8generator_new;

View File

@ -28,7 +28,7 @@ extern zend_class_entry *php_ce_v8object;
extern zend_class_entry *php_ce_v8function; extern zend_class_entry *php_ce_v8function;
/* Create PHP V8 object */ /* Create PHP V8 object */
void v8js_v8object_create(zval *, v8::Local<v8::Value>, int, v8::Isolate * TSRMLS_DC); void v8js_v8object_create(zval *, v8::Local<v8::Value>, int, v8::Isolate *);
static inline v8js_v8object *v8js_v8object_fetch_object(zend_object *obj) { static inline v8js_v8object *v8js_v8object_fetch_object(zend_object *obj) {
return (v8js_v8object *)((char *)obj - XtOffsetOf(struct v8js_v8object, std)); return (v8js_v8object *)((char *)obj - XtOffsetOf(struct v8js_v8object, std));

View File

@ -34,23 +34,23 @@ static void v8js_fetch_php_variable(v8::Local<v8::String> name, const v8::Proper
V8JS_TSRMLS_FETCH(); V8JS_TSRMLS_FETCH();
zend_is_auto_global(ctx->variable_name TSRMLS_CC); zend_is_auto_global(ctx->variable_name);
if ((variable = zend_hash_find(&EG(symbol_table), ctx->variable_name))) { if ((variable = zend_hash_find(&EG(symbol_table), ctx->variable_name))) {
info.GetReturnValue().Set(zval_to_v8js(variable, isolate TSRMLS_CC)); info.GetReturnValue().Set(zval_to_v8js(variable, isolate));
return; return;
} }
} }
/* }}} */ /* }}} */
void v8js_accessor_ctx_dtor(v8js_accessor_ctx *ctx TSRMLS_DC) /* {{{ */ void v8js_accessor_ctx_dtor(v8js_accessor_ctx *ctx) /* {{{ */
{ {
zend_string_release(ctx->variable_name); zend_string_release(ctx->variable_name);
efree(ctx); efree(ctx);
} }
/* }}} */ /* }}} */
void v8js_register_accessors(std::vector<v8js_accessor_ctx*> *accessor_list, v8::Local<v8::FunctionTemplate> php_obj_t, zval *array, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ void v8js_register_accessors(std::vector<v8js_accessor_ctx*> *accessor_list, v8::Local<v8::FunctionTemplate> php_obj_t, zval *array, v8::Isolate *isolate) /* {{{ */
{ {
zend_string *property_name; zend_string *property_name;
zval *item; zval *item;