From 227ad57163473372d766ecc9b27ad3442cfcf201 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Fri, 4 Dec 2015 20:14:47 +0100 Subject: [PATCH] prefer V8JS_ZSTR over V8JS_STRL(Z_STRVAL), refs #180 --- v8js_convert.cc | 2 +- v8js_methods.cc | 2 +- v8js_v8object_class.cc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/v8js_convert.cc b/v8js_convert.cc index c07ddb9..1920352 100644 --- a/v8js_convert.cc +++ b/v8js_convert.cc @@ -129,7 +129,7 @@ v8::Handle zval_to_v8js(zval *value, v8::Isolate *isolate TSRMLS_DC) break; case IS_STRING: - jsValue = V8JS_STRL(Z_STRVAL_P(value), Z_STRLEN_P(value)); + jsValue = V8JS_ZSTR(Z_STR_P(value)); break; case IS_LONG: diff --git a/v8js_methods.cc b/v8js_methods.cc index 5498ab3..f96730c 100644 --- a/v8js_methods.cc +++ b/v8js_methods.cc @@ -325,7 +325,7 @@ V8JS_METHOD(require) // Set script identifier v8::Local sname = V8JS_SYM("require"); - v8::Local source = V8JS_STRL(Z_STRVAL(module_code), Z_STRLEN(module_code)); + v8::Local source = V8JS_ZSTR(Z_STR(module_code)); zval_ptr_dtor(&module_code); // Create and compile script diff --git a/v8js_v8object_class.cc b/v8js_v8object_class.cc index 6da9855..ed3bf03 100644 --- a/v8js_v8object_class.cc +++ b/v8js_v8object_class.cc @@ -67,7 +67,7 @@ static int v8js_v8object_has_property(zval *object, zval *member, int has_set_ex { v8::Local jsObj = v8obj->ToObject(); - v8::Local jsKey = V8JS_STRL(Z_STRVAL_P(member), Z_STRLEN_P(member)); + v8::Local jsKey = V8JS_ZSTR(Z_STR_P(member)); v8::Local jsVal; /* Skip any prototype properties */ @@ -126,7 +126,7 @@ static zval *v8js_v8object_read_property(zval *object, zval *member, int type, v { v8::Local jsObj = v8obj->ToObject(); - v8::Local jsKey = V8JS_STRL(Z_STRVAL_P(member), Z_STRLEN_P(member)); + v8::Local jsKey = V8JS_ZSTR(Z_STR_P(member)); v8::Local jsVal; /* Skip any prototype properties */