From 8a3124ee2a1aa50dc87f476efedc30cd4bb36aac Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Fri, 2 Oct 2015 23:19:32 +0200 Subject: [PATCH] handle new IS_INDIRECT and IS_UNDEF in zval->js export --- v8js_convert.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/v8js_convert.cc b/v8js_convert.cc index 7f960f1..35e08e8 100644 --- a/v8js_convert.cc +++ b/v8js_convert.cc @@ -105,6 +105,9 @@ v8::Handle zval_to_v8js(zval *value, v8::Isolate *isolate TSRMLS_DC) long v; zend_class_entry *ce; + if(Z_TYPE_P(value) == IS_INDIRECT) + value = Z_INDIRECT_P(value); + switch (Z_TYPE_P(value)) { case IS_ARRAY: @@ -154,10 +157,14 @@ v8::Handle zval_to_v8js(zval *value, v8::Isolate *isolate TSRMLS_DC) jsValue = V8JS_FALSE(); break; - default: case IS_NULL: jsValue = V8JS_NULL; break; + + case IS_UNDEF: + default: + /* undefined -> return v8::Value left empty */ + break; } return jsValue; }