Skip to content

Commit 6705543

Browse files
committed
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).
1 parent 4376d59 commit 6705543

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

v8js_methods.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ static void v8js_dumper(v8::Isolate *isolate, v8::Local<v8::Value> var, int leve
138138
V8JS_GET_CLASS_NAME(cname, object);
139139
int hash = object->GetIdentityHash();
140140

141-
if (var->IsFunction())
141+
if (var->IsFunction() && strcmp(ToCString(cname), "Closure") != 0)
142142
{
143143
v8::String::Utf8Value csource(object->ToString());
144144
php_printf("object(Closure)#%d {\n%*c%s\n", hash, level * 2 + 2, ' ', ToCString(csource));

0 commit comments

Comments
 (0)