Skip to content

Commit 227ad57

Browse files
committed
prefer V8JS_ZSTR over V8JS_STRL(Z_STRVAL), refs #180
1 parent d9eb68b commit 227ad57

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

v8js_convert.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ v8::Handle<v8::Value> zval_to_v8js(zval *value, v8::Isolate *isolate TSRMLS_DC)
129129
break;
130130

131131
case IS_STRING:
132-
jsValue = V8JS_STRL(Z_STRVAL_P(value), Z_STRLEN_P(value));
132+
jsValue = V8JS_ZSTR(Z_STR_P(value));
133133
break;
134134

135135
case IS_LONG:

v8js_methods.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ V8JS_METHOD(require)
325325
// Set script identifier
326326
v8::Local<v8::String> sname = V8JS_SYM("require");
327327

328-
v8::Local<v8::String> source = V8JS_STRL(Z_STRVAL(module_code), Z_STRLEN(module_code));
328+
v8::Local<v8::String> source = V8JS_ZSTR(Z_STR(module_code));
329329
zval_ptr_dtor(&module_code);
330330

331331
// Create and compile script

v8js_v8object_class.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ static int v8js_v8object_has_property(zval *object, zval *member, int has_set_ex
6767
{
6868

6969
v8::Local<v8::Object> jsObj = v8obj->ToObject();
70-
v8::Local<v8::String> jsKey = V8JS_STRL(Z_STRVAL_P(member), Z_STRLEN_P(member));
70+
v8::Local<v8::String> jsKey = V8JS_ZSTR(Z_STR_P(member));
7171
v8::Local<v8::Value> jsVal;
7272

7373
/* Skip any prototype properties */
@@ -126,7 +126,7 @@ static zval *v8js_v8object_read_property(zval *object, zval *member, int type, v
126126
{
127127

128128
v8::Local<v8::Object> jsObj = v8obj->ToObject();
129-
v8::Local<v8::String> jsKey = V8JS_STRL(Z_STRVAL_P(member), Z_STRLEN_P(member));
129+
v8::Local<v8::String> jsKey = V8JS_ZSTR(Z_STR_P(member));
130130
v8::Local<v8::Value> jsVal;
131131

132132
/* Skip any prototype properties */

0 commit comments

Comments
 (0)