From 8858bf5f27ad7bb0ac3729e940b3067a99464ae7 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Sat, 21 Dec 2013 20:07:33 +0100 Subject: [PATCH] Make compatible with V8 3.23.2 (and below) --- v8js_convert.cc | 10 +++++----- v8js_methods.cc | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/v8js_convert.cc b/v8js_convert.cc index 5a1b878..8e9c2ab 100644 --- a/v8js_convert.cc +++ b/v8js_convert.cc @@ -216,7 +216,7 @@ static void php_v8js_construct_callback(const v8::FunctionCallbackInfoSetAlignedPointerInInternalField(0, ext_tmpl->Value()); @@ -279,7 +279,7 @@ static void php_v8js_weak_closure_callback(const v8::WeakCallbackDataGetFunction() + v8::FunctionTemplate::New(php_v8js_php_callback, V8JS_NEW(v8::External, (isolate), mptr), V8JS_NEW(v8::Signature, (isolate), tmpl))->GetFunction() static void php_v8js_named_property_enumerator(const v8::PropertyCallbackInfo &info) /* {{{ */ @@ -735,13 +735,13 @@ static v8::Handle php_v8js_hash_to_jsobj(zval *value, v8::Isolate *is } } v8::Local call_handler_data = V8JS_NEW(v8::Array, isolate, 2); - call_handler_data->Set(0, v8::External::New(isolate, persist_tpl_)); - call_handler_data->Set(1, v8::External::New(isolate, ce)); + call_handler_data->Set(0, V8JS_NEW(v8::External, isolate, persist_tpl_)); + call_handler_data->Set(1, V8JS_NEW(v8::External, isolate, ce)); new_tpl->SetCallHandler(php_v8js_construct_callback, call_handler_data); } // Create v8 wrapper object - v8::Handle external = v8::External::New(isolate, value); + v8::Handle external = V8JS_NEW(v8::External, isolate, value); newobj = new_tpl->GetFunction()->NewInstance(1, &external); if (ce == zend_ce_closure) { diff --git a/v8js_methods.cc b/v8js_methods.cc index 61efe31..04716bc 100644 --- a/v8js_methods.cc +++ b/v8js_methods.cc @@ -300,7 +300,7 @@ V8JS_METHOD(require) v8::Handle global = v8::ObjectTemplate::New(); global->Set(V8JS_SYM("print"), v8::FunctionTemplate::New(V8JS_MN(print)), v8::ReadOnly); global->Set(V8JS_SYM("sleep"), v8::FunctionTemplate::New(V8JS_MN(sleep)), v8::ReadOnly); - global->Set(V8JS_SYM("require"), v8::FunctionTemplate::New(V8JS_MN(require), v8::External::New(isolate, c)), v8::ReadOnly); + global->Set(V8JS_SYM("require"), v8::FunctionTemplate::New(V8JS_MN(require), V8JS_NEW(v8::External, isolate, c)), v8::ReadOnly); // Add the exports object in which the module can return its API v8::Local exports_template = v8::ObjectTemplate::New(); @@ -393,7 +393,7 @@ void php_v8js_register_methods(v8::Handle global, php_v8js_c global->Set(V8JS_SYM("var_dump"), v8::FunctionTemplate::New(V8JS_MN(var_dump)), v8::ReadOnly); c->modules_base.push_back(""); - global->Set(V8JS_SYM("require"), v8::FunctionTemplate::New(V8JS_MN(require), v8::External::New(isolate, c)), v8::ReadOnly); + global->Set(V8JS_SYM("require"), v8::FunctionTemplate::New(V8JS_MN(require), V8JS_NEW(v8::External, isolate, c)), v8::ReadOnly); } /* }}} */