Browse Source

fixed Std.is(NaN,Int)

Nicolas Cannasse 13 years ago
parent
commit
72729ae4a5
1 changed files with 1 additions and 1 deletions
  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';