소스 검색

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';