From 670554306a3c2f6ef813d5c0caa961f4033901a4 Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Sat, 28 Nov 2015 15:18:38 +0100 Subject: [PATCH] Fix tests/var_dump.phpt Recent V8 versions (e.g. 4.8.253 or 4.9.19) consider `IsFunction() = true` for Closure objects from PHP; but earlier versions didn't. This ensures consistent var_dump behaviour (sticking to the behaviour with older V8 versions). --- v8js_methods.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v8js_methods.cc b/v8js_methods.cc index 722736b..c16eda5 100644 --- a/v8js_methods.cc +++ b/v8js_methods.cc @@ -138,7 +138,7 @@ static void v8js_dumper(v8::Isolate *isolate, v8::Local var, int leve V8JS_GET_CLASS_NAME(cname, object); int hash = object->GetIdentityHash(); - if (var->IsFunction()) + if (var->IsFunction() && strcmp(ToCString(cname), "Closure") != 0) { v8::String::Utf8Value csource(object->ToString()); php_printf("object(Closure)#%d {\n%*c%s\n", hash, level * 2 + 2, ' ', ToCString(csource));