浏览代码

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).
Stefan Siegl 9 年之前
父节点
当前提交
670554306a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      v8js_methods.cc

+ 1 - 1
v8js_methods.cc

@@ -138,7 +138,7 @@ static void v8js_dumper(v8::Isolate *isolate, v8::Local<v8::Value> 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));