Permalink
Browse files

Replaced deprecated v8 functions with newer equivalents

  • Loading branch information...
1 parent 86f3505 commit b89f085888e747bcf528d5107e80a81dfe60c376 @tenorviol committed Mar 18, 2013
Showing with 6 additions and 6 deletions.
  1. +6 −6 v8js_convert.cc
View
@@ -37,7 +37,7 @@ extern "C" {
static v8::Handle<v8::Value> php_v8js_php_callback(const v8::Arguments &args) /* {{{ */
{
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_fcall_info fci;
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 */
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 {
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];
}
value = cb->Call(self, argc, argv);
- }
+ }
else /* __call() */
- {
+ {
v8::Local<v8::Array> argsarr = v8::Array::New(argc);
for (; i < argc; ++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->SetPointerInInternalField(0, (void *) value);
+ newobj->SetAlignedPointerInInternalField(0, (void *) value);
} else {
new_tpl->SetClassName(V8JS_SYM("Array"));
newobj = new_tpl->InstanceTemplate()->NewInstance();
@@ -518,7 +518,7 @@ v8::Handle<v8::Value> zval_to_v8js(zval *value TSRMLS_DC) /* {{{ */
jsValue = V8JS_NULL;
break;
}
- return jsValue;
+ return jsValue;
}
/* }}} */

0 comments on commit b89f085

Please sign in to comment.