mirror of
https://github.com/phpv8/v8js.git
synced 2025-01-03 14:31:53 +00:00
adapt to changed ZVAL_STRING/ZVAL_STRINGL/RETVAL_STRINGL macros
This commit is contained in:
parent
45f7e18624
commit
8389e126b5
@ -37,11 +37,9 @@ static zval *v8js_array_access_dispatch(zval *object, const char *method_name, i
|
|||||||
zval *php_value;
|
zval *php_value;
|
||||||
|
|
||||||
zval fmember;
|
zval fmember;
|
||||||
INIT_ZVAL(fmember);
|
ZVAL_STRING(&fmember, method_name);
|
||||||
ZVAL_STRING(&fmember, method_name, 0);
|
|
||||||
|
|
||||||
zval zindex;
|
zval zindex;
|
||||||
INIT_ZVAL(zindex);
|
|
||||||
ZVAL_LONG(&zindex, index);
|
ZVAL_LONG(&zindex, index);
|
||||||
|
|
||||||
fci.size = sizeof(fci);
|
fci.size = sizeof(fci);
|
||||||
|
@ -436,8 +436,7 @@ static PHP_METHOD(V8Js, __construct)
|
|||||||
}
|
}
|
||||||
|
|
||||||
zval zmember;
|
zval zmember;
|
||||||
INIT_ZVAL(zmember);
|
ZVAL_STRING(&zmember, member);
|
||||||
ZVAL_STRING(&zmember, member, 0);
|
|
||||||
|
|
||||||
zend_property_info *property_info = zend_get_property_info(c->std.ce, &zmember, 1 TSRMLS_CC);
|
zend_property_info *property_info = zend_get_property_info(c->std.ce, &zmember, 1 TSRMLS_CC);
|
||||||
if(property_info && property_info->flags & ZEND_ACC_PUBLIC) {
|
if(property_info && property_info->flags & ZEND_ACC_PUBLIC) {
|
||||||
|
@ -171,8 +171,7 @@ int v8js_to_zval(v8::Handle<v8::Value> jsValue, zval *return_value, int flags, v
|
|||||||
{
|
{
|
||||||
v8::String::Utf8Value str(jsValue);
|
v8::String::Utf8Value str(jsValue);
|
||||||
const char *cstr = ToCString(str);
|
const char *cstr = ToCString(str);
|
||||||
RETVAL_STRINGL(cstr, jsValue->ToString()->Utf8Length(), 1);
|
RETVAL_STRINGL(cstr, jsValue->ToString()->Utf8Length());
|
||||||
// RETVAL_STRING(cstr, 1);
|
|
||||||
}
|
}
|
||||||
else if (jsValue->IsBoolean())
|
else if (jsValue->IsBoolean())
|
||||||
{
|
{
|
||||||
|
@ -268,7 +268,7 @@ V8JS_METHOD(require)
|
|||||||
zval *normalised_path_zend;
|
zval *normalised_path_zend;
|
||||||
|
|
||||||
MAKE_STD_ZVAL(normalised_path_zend);
|
MAKE_STD_ZVAL(normalised_path_zend);
|
||||||
ZVAL_STRING(normalised_path_zend, normalised_module_id, 1);
|
ZVAL_STRING(normalised_path_zend, normalised_module_id);
|
||||||
|
|
||||||
zval **params[1] = {&normalised_path_zend};
|
zval **params[1] = {&normalised_path_zend};
|
||||||
if (FAILURE == call_user_function_ex(EG(function_table), NULL, c->module_loader, &module_code, 1, params, 0, NULL TSRMLS_CC)) {
|
if (FAILURE == call_user_function_ex(EG(function_table), NULL, c->module_loader, &module_code, 1, params, 0, NULL TSRMLS_CC)) {
|
||||||
|
@ -48,13 +48,12 @@ static void v8js_call_php_func(zval *value, zend_class_entry *ce, zend_function
|
|||||||
max_num_args = method_ptr->common.num_args;
|
max_num_args = method_ptr->common.num_args;
|
||||||
|
|
||||||
/* Function name to call */
|
/* Function name to call */
|
||||||
INIT_ZVAL(fname);
|
ZVAL_STRING(&fname, method_ptr->common.function_name);
|
||||||
ZVAL_STRING(&fname, method_ptr->common.function_name, 0);
|
|
||||||
|
|
||||||
/* zend_fcall_info */
|
/* zend_fcall_info */
|
||||||
fci.size = sizeof(fci);
|
fci.size = sizeof(fci);
|
||||||
fci.function_table = &ce->function_table;
|
fci.function_table = &ce->function_table;
|
||||||
fci.function_name = &fname;
|
fci.function_name = fname;
|
||||||
fci.symbol_table = NULL;
|
fci.symbol_table = NULL;
|
||||||
fci.object_ptr = value;
|
fci.object_ptr = value;
|
||||||
fci.retval_ptr_ptr = &retval_ptr;
|
fci.retval_ptr_ptr = &retval_ptr;
|
||||||
@ -598,7 +597,7 @@ inline v8::Local<v8::Value> v8js_named_property_callback(v8::Local<v8::String> p
|
|||||||
/* Nope, not a method -- must be a (case-sensitive) property */
|
/* Nope, not a method -- must be a (case-sensitive) property */
|
||||||
zval zname;
|
zval zname;
|
||||||
INIT_ZVAL(zname);
|
INIT_ZVAL(zname);
|
||||||
ZVAL_STRINGL(&zname, name, name_len, 0);
|
ZVAL_STRINGL(&zname, name, name_len);
|
||||||
zend_property_info *property_info = zend_get_property_info(ce, &zname, 1 TSRMLS_CC);
|
zend_property_info *property_info = zend_get_property_info(ce, &zname, 1 TSRMLS_CC);
|
||||||
|
|
||||||
if(property_info && property_info->flags & ZEND_ACC_PUBLIC) {
|
if(property_info && property_info->flags & ZEND_ACC_PUBLIC) {
|
||||||
@ -625,8 +624,7 @@ inline v8::Local<v8::Value> v8js_named_property_callback(v8::Local<v8::String> p
|
|||||||
zend_fcall_info fci;
|
zend_fcall_info fci;
|
||||||
|
|
||||||
zval fmember;
|
zval fmember;
|
||||||
INIT_ZVAL(fmember);
|
ZVAL_STRING(&fmember, "__get");
|
||||||
ZVAL_STRING(&fmember, "__get", 0);
|
|
||||||
|
|
||||||
fci.size = sizeof(fci);
|
fci.size = sizeof(fci);
|
||||||
fci.function_table = &ce->function_table;
|
fci.function_table = &ce->function_table;
|
||||||
@ -655,8 +653,7 @@ inline v8::Local<v8::Value> v8js_named_property_callback(v8::Local<v8::String> p
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
zval zname;
|
zval zname;
|
||||||
INIT_ZVAL(zname);
|
ZVAL_STRINGL(&zname, name, name_len);
|
||||||
ZVAL_STRINGL(&zname, name, name_len, 0);
|
|
||||||
zend_property_info *property_info = zend_get_property_info(ce, &zname, 1 TSRMLS_CC);
|
zend_property_info *property_info = zend_get_property_info(ce, &zname, 1 TSRMLS_CC);
|
||||||
|
|
||||||
if(property_info && property_info->flags & ZEND_ACC_PUBLIC) {
|
if(property_info && property_info->flags & ZEND_ACC_PUBLIC) {
|
||||||
@ -670,8 +667,7 @@ inline v8::Local<v8::Value> v8js_named_property_callback(v8::Local<v8::String> p
|
|||||||
zend_fcall_info fci;
|
zend_fcall_info fci;
|
||||||
|
|
||||||
zval fmember;
|
zval fmember;
|
||||||
INIT_ZVAL(fmember);
|
ZVAL_STRING(&fmember, "__set");
|
||||||
ZVAL_STRING(&fmember, "__set", 0);
|
|
||||||
|
|
||||||
zval *php_ret_value;
|
zval *php_ret_value;
|
||||||
|
|
||||||
@ -705,7 +701,7 @@ inline v8::Local<v8::Value> v8js_named_property_callback(v8::Local<v8::String> p
|
|||||||
const zend_object_handlers *h = Z_OBJ_HT_P(object);
|
const zend_object_handlers *h = Z_OBJ_HT_P(object);
|
||||||
zval *prop;
|
zval *prop;
|
||||||
MAKE_STD_ZVAL(prop);
|
MAKE_STD_ZVAL(prop);
|
||||||
ZVAL_STRINGL(prop, name, name_len, 1);
|
ZVAL_STRINGL(prop, name, name_len);
|
||||||
|
|
||||||
if (callback_type == V8JS_PROP_QUERY) {
|
if (callback_type == V8JS_PROP_QUERY) {
|
||||||
if (h->has_property(object, prop, 0 ZEND_HASH_KEY_NULL TSRMLS_CC)) {
|
if (h->has_property(object, prop, 0 ZEND_HASH_KEY_NULL TSRMLS_CC)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user