From d97832d9fba3d2d97979c203e8cee13c5916660a Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Sat, 11 Mar 2017 13:31:40 +0100 Subject: [PATCH] v8::Handle -> v8::Local --- php_v8js_macros.h | 8 ++++---- v8js_array_access.cc | 2 +- v8js_convert.cc | 10 +++++----- v8js_exceptions.cc | 2 +- v8js_methods.cc | 2 +- v8js_object_export.cc | 30 +++++++++++++++--------------- v8js_object_export.h | 2 +- v8js_v8.cc | 2 +- v8js_v8.h | 2 +- v8js_v8object_class.cc | 2 +- v8js_v8object_class.h | 2 +- v8js_variables.cc | 2 +- 12 files changed, 33 insertions(+), 33 deletions(-) diff --git a/php_v8js_macros.h b/php_v8js_macros.h index 0196b74..3232aa9 100644 --- a/php_v8js_macros.h +++ b/php_v8js_macros.h @@ -79,13 +79,13 @@ extern "C" { /* Convert zval into V8 value */ -v8::Handle zval_to_v8js(zval *, v8::Isolate *); +v8::Local zval_to_v8js(zval *, v8::Isolate *); /* Convert zend_long into V8 value */ -v8::Handle zend_long_to_v8js(zend_long, v8::Isolate *); +v8::Local zend_long_to_v8js(zend_long, v8::Isolate *); /* Convert V8 value into zval */ -int v8js_to_zval(v8::Handle, zval *, int, v8::Isolate * TSRMLS_DC); +int v8js_to_zval(v8::Local, zval *, int, v8::Isolate * TSRMLS_DC); struct v8js_accessor_ctx { @@ -159,7 +159,7 @@ struct _v8js_process_globals { extern struct _v8js_process_globals v8js_process_globals; /* Register builtin methods into passed object */ -void v8js_register_methods(v8::Handle, v8js_ctx *c); +void v8js_register_methods(v8::Local, v8js_ctx *c); #endif /* PHP_V8JS_MACROS_H */ diff --git a/v8js_array_access.cc b/v8js_array_access.cc index 5fda1d7..bf36269 100644 --- a/v8js_array_access.cc +++ b/v8js_array_access.cc @@ -94,7 +94,7 @@ void v8js_array_access_setter(uint32_t index, v8::Local value, ZVAL_UNDEF(&zvalue); if (v8js_to_zval(value, &zvalue, 0, isolate TSRMLS_CC) != SUCCESS) { - info.GetReturnValue().Set(v8::Handle()); + info.GetReturnValue().Set(v8::Local()); return; } diff --git a/v8js_convert.cc b/v8js_convert.cc index 1dd95cc..d181ae7 100644 --- a/v8js_convert.cc +++ b/v8js_convert.cc @@ -57,7 +57,7 @@ static int v8js_is_assoc_array(HashTable *myht TSRMLS_DC) /* {{{ */ /* }}} */ -static v8::Handle v8js_hash_to_jsarr(zval *value, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ +static v8::Local v8js_hash_to_jsarr(zval *value, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ { HashTable *myht = HASH_OF(value); int i = myht ? zend_hash_num_elements(myht) : 0; @@ -100,7 +100,7 @@ static v8::Handle v8js_hash_to_jsarr(zval *value, v8::Isolate *isolat } /* }}} */ -v8::Handle zend_long_to_v8js(zend_long v, v8::Isolate *isolate) /* {{{ */ +v8::Local zend_long_to_v8js(zend_long v, v8::Isolate *isolate) /* {{{ */ { if (v < - std::numeric_limits::min() || v > std::numeric_limits::max()) { return V8JS_FLOAT(static_cast(v)); @@ -110,9 +110,9 @@ v8::Handle zend_long_to_v8js(zend_long v, v8::Isolate *isolate) /* {{ } /* }}} */ -v8::Handle zval_to_v8js(zval *value, v8::Isolate *isolate) /* {{{ */ +v8::Local zval_to_v8js(zval *value, v8::Isolate *isolate) /* {{{ */ { - v8::Handle jsValue; + v8::Local jsValue; zend_string *value_str; zend_class_entry *ce; @@ -186,7 +186,7 @@ v8::Handle zval_to_v8js(zval *value, v8::Isolate *isolate) /* {{{ */ } /* }}} */ -int v8js_to_zval(v8::Handle jsValue, zval *return_value, int flags, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ +int v8js_to_zval(v8::Local jsValue, zval *return_value, int flags, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ { if (jsValue->IsString()) { diff --git a/v8js_exceptions.cc b/v8js_exceptions.cc index 5fa4281..6d5a9a8 100644 --- a/v8js_exceptions.cc +++ b/v8js_exceptions.cc @@ -41,7 +41,7 @@ void v8js_create_script_exception(zval *return_value, v8::Isolate *isolate, v8:: { v8::String::Utf8Value exception(try_catch->Exception()); const char *exception_string = ToCString(exception); - v8::Handle tc_message = try_catch->Message(); + v8::Local tc_message = try_catch->Message(); const char *filename_string, *sourceline_string; char *message_string; int linenum, start_col, end_col; diff --git a/v8js_methods.cc b/v8js_methods.cc index 5cd0edf..a939d12 100644 --- a/v8js_methods.cc +++ b/v8js_methods.cc @@ -502,7 +502,7 @@ V8JS_METHOD(require) info.GetReturnValue().Set(newobj); } -void v8js_register_methods(v8::Handle global, v8js_ctx *c) /* {{{ */ +void v8js_register_methods(v8::Local global, v8js_ctx *c) /* {{{ */ { v8::Isolate *isolate = c->isolate; global->Set(V8JS_SYM("exit"), v8::FunctionTemplate::New(isolate, V8JS_MN(exit)), v8::ReadOnly); diff --git a/v8js_object_export.cc b/v8js_object_export.cc index 5e6fcd9..5cac0bb 100644 --- a/v8js_object_export.cc +++ b/v8js_object_export.cc @@ -37,7 +37,7 @@ static void v8js_weak_object_callback(const v8::WeakCallbackInfo &d /* 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& info TSRMLS_DC) /* {{{ */ { - v8::Handle return_value = V8JS_NULL; + v8::Local return_value = V8JS_NULL; zend_fcall_info fci; zend_fcall_info_cache fcc; zval fname, retval; @@ -211,7 +211,7 @@ static void v8js_construct_callback(const v8::FunctionCallbackInfo& i v8::Isolate *isolate = info.GetIsolate(); info.GetReturnValue().Set(V8JS_UNDEFINED); - v8::Handle newobj = info.This(); + v8::Local newobj = info.This(); zval value; if (!info.IsConstructCall()) { @@ -460,7 +460,7 @@ static void v8js_fake_call_impl(const v8::FunctionCallbackInfo& info) { v8::Isolate *isolate = info.GetIsolate(); v8::Local self = info.Holder(); - v8::Handle return_value = V8JS_NULL; + v8::Local return_value = V8JS_NULL; char *error; size_t error_len; @@ -674,7 +674,7 @@ v8::Local v8js_named_property_callback(v8::Local property ret_value = V8JS_BOOL(false); } else { /* shouldn't reach here! but bail safely */ - ret_value = v8::Handle(); + ret_value = v8::Local(); } } else { if (name[0]=='$') { @@ -697,7 +697,7 @@ v8::Local v8js_named_property_callback(v8::Local property // (indicating that we don't intercept this property) if the // property doesn't exist. if (property_val == &EG(uninitialized_zval)) { - ret_value = v8::Handle(); + ret_value = v8::Local(); } else { // wrap it ret_value = zval_to_v8js(property_val, isolate TSRMLS_CC); @@ -719,7 +719,7 @@ v8::Local v8js_named_property_callback(v8::Local property } else if (callback_type == V8JS_PROP_SETTER) { if (v8js_to_zval(set_value, &php_value, ctx->flags, isolate TSRMLS_CC) != SUCCESS) { - ret_value = v8::Handle(); + ret_value = v8::Local(); } else { zend_property_info *property_info = zend_get_property_info(ce, Z_STR(zname), 1 TSRMLS_CC); @@ -752,7 +752,7 @@ v8::Local v8js_named_property_callback(v8::Local property if (h->has_property(&zobject, &zname, 0, NULL TSRMLS_CC)) { ret_value = V8JS_UINT(v8::None); } else { - ret_value = v8::Handle(); // empty handle + ret_value = v8::Local(); // empty handle } } else { zend_property_info *property_info = zend_get_property_info(ce, Z_STR(zname), 1 TSRMLS_CC); @@ -764,12 +764,12 @@ v8::Local v8js_named_property_callback(v8::Local property ret_value = V8JS_TRUE(); } else { - ret_value = v8::Handle(); // empty handle + ret_value = v8::Local(); // empty handle } } } else { /* shouldn't reach here! but bail safely */ - ret_value = v8::Handle(); + ret_value = v8::Local(); } zval_ptr_dtor(&zname); @@ -813,7 +813,7 @@ static void v8js_named_property_deleter(v8::Local property, const v8 -static v8::Handle v8js_wrap_object(v8::Isolate *isolate, zend_class_entry *ce, zval *value TSRMLS_DC) /* {{{ */ +static v8::Local v8js_wrap_object(v8::Isolate *isolate, zend_class_entry *ce, zval *value TSRMLS_DC) /* {{{ */ { v8js_ctx *ctx = (v8js_ctx *) isolate->GetData(0); v8::Local new_tpl; @@ -911,8 +911,8 @@ static v8::Handle v8js_wrap_object(v8::Isolate *isolate, zend_class_ } // Create v8 wrapper object - v8::Handle external = v8::External::New(isolate, Z_OBJ_P(value)); - v8::Handle newobj = new_tpl->GetFunction()->NewInstance(1, &external); + v8::Local external = v8::External::New(isolate, Z_OBJ_P(value)); + v8::Local newobj = new_tpl->GetFunction()->NewInstance(1, &external); if (ce == zend_ce_closure) { // free uncached function template when object is freed @@ -925,7 +925,7 @@ static v8::Handle v8js_wrap_object(v8::Isolate *isolate, zend_class_ /* }}} */ -static v8::Handle v8js_wrap_array_to_object(v8::Isolate *isolate, zval *value TSRMLS_DC) /* {{{ */ +static v8::Local v8js_wrap_array_to_object(v8::Isolate *isolate, zval *value TSRMLS_DC) /* {{{ */ { int i; zend_string *key; @@ -948,7 +948,7 @@ static v8::Handle v8js_wrap_array_to_object(v8::Isolate *isolate, zv new_tpl = v8::Local::New(isolate, ctx->array_tmpl); } - v8::Handle newobj = new_tpl->InstanceTemplate()->NewInstance(); + v8::Local newobj = new_tpl->InstanceTemplate()->NewInstance(); HashTable *myht = HASH_OF(value); i = myht ? zend_hash_num_elements(myht) : 0; @@ -1003,7 +1003,7 @@ static v8::Handle v8js_wrap_array_to_object(v8::Isolate *isolate, zv /* }}} */ -v8::Handle v8js_hash_to_jsobj(zval *value, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ +v8::Local v8js_hash_to_jsobj(zval *value, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ { HashTable *myht; zend_class_entry *ce = NULL; diff --git a/v8js_object_export.h b/v8js_object_export.h index 9e3ec84..bf5be2c 100644 --- a/v8js_object_export.h +++ b/v8js_object_export.h @@ -14,7 +14,7 @@ #ifndef V8JS_OBJECT_EXPORT_H #define V8JS_OBJECT_EXPORT_H -v8::Handle v8js_hash_to_jsobj(zval *value, v8::Isolate *isolate TSRMLS_DC); +v8::Local v8js_hash_to_jsobj(zval *value, v8::Isolate *isolate TSRMLS_DC); typedef enum { diff --git a/v8js_v8.cc b/v8js_v8.cc index 16809f2..8ef473d 100644 --- a/v8js_v8.cc +++ b/v8js_v8.cc @@ -258,7 +258,7 @@ void v8js_terminate_execution(v8::Isolate *isolate) /* {{{ */ /* }}} */ -int v8js_get_properties_hash(v8::Handle jsValue, HashTable *retval, int flags, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ +int v8js_get_properties_hash(v8::Local jsValue, HashTable *retval, int flags, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ { v8::Local jsObj = jsValue->ToObject(); diff --git a/v8js_v8.h b/v8js_v8.h index 7a761b6..310ea93 100644 --- a/v8js_v8.h +++ b/v8js_v8.h @@ -58,7 +58,7 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value, void v8js_terminate_execution(v8::Isolate *isolate); /* Fetch V8 object properties */ -int v8js_get_properties_hash(v8::Handle jsValue, HashTable *retval, int flags, v8::Isolate *isolate TSRMLS_DC); +int v8js_get_properties_hash(v8::Local jsValue, HashTable *retval, int flags, v8::Isolate *isolate TSRMLS_DC); #define V8JS_CTX_PROLOGUE_EX(ctx, ret) \ if (!V8JSG(v8_initialized)) { \ diff --git a/v8js_v8object_class.cc b/v8js_v8object_class.cc index 95b8834..fbeb101 100644 --- a/v8js_v8object_class.cc +++ b/v8js_v8object_class.cc @@ -688,7 +688,7 @@ PHP_METHOD(V8Generator, valid) /* }}} */ -void v8js_v8object_create(zval *res, v8::Handle value, int flags, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ +void v8js_v8object_create(zval *res, v8::Local value, int flags, v8::Isolate *isolate TSRMLS_DC) /* {{{ */ { v8js_ctx *ctx = (v8js_ctx *) isolate->GetData(0); diff --git a/v8js_v8object_class.h b/v8js_v8object_class.h index 4e1ded1..7bf0877 100644 --- a/v8js_v8object_class.h +++ b/v8js_v8object_class.h @@ -28,7 +28,7 @@ extern zend_class_entry *php_ce_v8object; extern zend_class_entry *php_ce_v8function; /* Create PHP V8 object */ -void v8js_v8object_create(zval *, v8::Handle, int, v8::Isolate * TSRMLS_DC); +void v8js_v8object_create(zval *, v8::Local, int, v8::Isolate * TSRMLS_DC); static inline v8js_v8object *v8js_v8object_fetch_object(zend_object *obj) { return (v8js_v8object *)((char *)obj - XtOffsetOf(struct v8js_v8object, std)); diff --git a/v8js_variables.cc b/v8js_variables.cc index 654dce7..246af07 100644 --- a/v8js_variables.cc +++ b/v8js_variables.cc @@ -27,7 +27,7 @@ extern "C" { static void v8js_fetch_php_variable(v8::Local name, const v8::PropertyCallbackInfo& info) /* {{{ */ { - v8::Handle data = v8::Handle::Cast(info.Data()); + v8::Local data = v8::Local::Cast(info.Data()); v8js_accessor_ctx *ctx = static_cast(data->Value()); v8::Isolate *isolate = ctx->isolate; zval *variable;