0
0
mirror of https://github.com/phpv8/v8js.git synced 2025-01-03 11:21:51 +00:00

Replaced deprecated v8 functions with newer equivalents

This commit is contained in:
Chris Johnson 2013-03-17 20:46:03 -07:00
parent 86f350597c
commit b89f085888

View File

@ -37,7 +37,7 @@ extern "C" {
static v8::Handle<v8::Value> php_v8js_php_callback(const v8::Arguments &args) /* {{{ */ static v8::Handle<v8::Value> php_v8js_php_callback(const v8::Arguments &args) /* {{{ */
{ {
v8::Handle<v8::Value> return_value; v8::Handle<v8::Value> return_value;
zval *value = reinterpret_cast<zval *>(args.This()->GetPointerFromInternalField(0)); zval *value = reinterpret_cast<zval *>(args.This()->GetAlignedPointerFromInternalField(0));
zend_function *method_ptr; zend_function *method_ptr;
zend_fcall_info fci; zend_fcall_info fci;
zend_fcall_info_cache fcc; zend_fcall_info_cache fcc;
@ -50,7 +50,7 @@ static v8::Handle<v8::Value> php_v8js_php_callback(const v8::Arguments &args) /*
/* Set method_ptr from v8::External or fetch the closure invoker */ /* Set method_ptr from v8::External or fetch the closure invoker */
if (!args.Data().IsEmpty() && args.Data()->IsExternal()) { if (!args.Data().IsEmpty() && args.Data()->IsExternal()) {
method_ptr = static_cast<zend_function *>(v8::External::Unwrap(args.Data())); method_ptr = static_cast<zend_function *>(v8::External::Cast(*args.Data())->Value());
} else { } else {
method_ptr = zend_get_closure_invoke_method(value TSRMLS_CC); method_ptr = zend_get_closure_invoke_method(value TSRMLS_CC);
} }
@ -186,9 +186,9 @@ static v8::Handle<v8::Value> php_v8js_property_caller(const v8::Arguments &args)
argv[i] = args[i]; argv[i] = args[i];
} }
value = cb->Call(self, argc, argv); value = cb->Call(self, argc, argv);
} }
else /* __call() */ else /* __call() */
{ {
v8::Local<v8::Array> argsarr = v8::Array::New(argc); v8::Local<v8::Array> argsarr = v8::Array::New(argc);
for (; i < argc; ++i) { for (; i < argc; ++i) {
argsarr->Set(i, args[i]); argsarr->Set(i, args[i]);
@ -384,7 +384,7 @@ static v8::Handle<v8::Value> php_v8js_hash_to_jsobj(zval *value TSRMLS_DC) /* {{
newobj->SetHiddenValue(V8JS_SYM(ZEND_ISSET_FUNC_NAME), PHP_V8JS_CALLBACK(isset_ptr)); newobj->SetHiddenValue(V8JS_SYM(ZEND_ISSET_FUNC_NAME), PHP_V8JS_CALLBACK(isset_ptr));
} }
} }
newobj->SetPointerInInternalField(0, (void *) value); newobj->SetAlignedPointerInInternalField(0, (void *) value);
} else { } else {
new_tpl->SetClassName(V8JS_SYM("Array")); new_tpl->SetClassName(V8JS_SYM("Array"));
newobj = new_tpl->InstanceTemplate()->NewInstance(); newobj = new_tpl->InstanceTemplate()->NewInstance();
@ -518,7 +518,7 @@ v8::Handle<v8::Value> zval_to_v8js(zval *value TSRMLS_DC) /* {{{ */
jsValue = V8JS_NULL; jsValue = V8JS_NULL;
break; break;
} }
return jsValue; return jsValue;
} }
/* }}} */ /* }}} */