mirror of
https://github.com/phpv8/v8js.git
synced 2025-01-03 11:21:51 +00:00
Handle NULL in global.var_dump().
This commit is contained in:
parent
0e1c6ef5e9
commit
c725a80674
@ -57,14 +57,20 @@ V8JS_METHOD(print) /* {{{ */
|
||||
|
||||
static void _php_v8js_dumper(v8::Local<v8::Value> var, int level TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
v8::String::Utf8Value str(var->ToDetailString());
|
||||
const char *valstr = ToCString(str);
|
||||
size_t valstr_len = (valstr) ? strlen(valstr) : 0;
|
||||
|
||||
if (level > 1) {
|
||||
php_printf("%*c", (level - 1) * 2, ' ');
|
||||
}
|
||||
|
||||
if (var->IsNull())
|
||||
{
|
||||
php_printf("NULL\n");
|
||||
return;
|
||||
}
|
||||
|
||||
v8::String::Utf8Value str(var->ToDetailString());
|
||||
const char *valstr = ToCString(str);
|
||||
size_t valstr_len = (valstr) ? strlen(valstr) : 0;
|
||||
|
||||
if (var->IsString())
|
||||
{
|
||||
php_printf("string(%zu) \"%s\"\n", valstr_len, valstr);
|
||||
|
Loading…
Reference in New Issue
Block a user