浏览代码

fixed Std.is(NaN,Int)

Nicolas Cannasse 13 年之前
父节点
当前提交
72729ae4a5
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      std/php/Boot.hx

+ 1 - 1
std/php/Boot.hx

@@ -367,7 +367,7 @@ function _hx_instanceof($v, $t) {
 		case 'Array'  : return is_array($v);
 		case 'String' : return is_string($v) && !_hx_is_lambda($v);
 		case 'Bool'   : return is_bool($v);
-		case 'Int'    : return is_int($v) || (is_float($v) && intval($v) == $v);
+		case 'Int'    : return is_int($v) || (is_float($v) && intval($v) == $v && !is_nan($v));
 		case 'Float'  : return is_float($v) || is_int($v);
 		case 'Dynamic': return true;
 		case 'Class'  : return ($v instanceof _hx_class || $v instanceof _hx_interface) && $v->__tname__ != 'Enum';