Browse Source

fixed Infinity is Int.

Nicolas Cannasse 19 years ago
parent
commit
c9c55797a4
2 changed files with 2 additions and 2 deletions
  1. 1 1
      std/flash/Boot.hx
  2. 1 1
      std/js/Boot.hx

+ 1 - 1
std/flash/Boot.hx

@@ -95,7 +95,7 @@ class Boot {
 				return true;
 				return true;
 			switch( cl ) {
 			switch( cl ) {
 			case Int:
 			case Int:
-				return Math.ceil(o) == o; // error with NaN
+				return (Math.ceil(o) == o) && isFinite(o);
 			case Float:
 			case Float:
 				return __typeof__(o) == "number";
 				return __typeof__(o) == "number";
 			case Bool:
 			case Bool:

+ 1 - 1
std/js/Boot.hx

@@ -131,7 +131,7 @@ class Boot {
 			}
 			}
 			switch( cl ) {
 			switch( cl ) {
 			case Int:
 			case Int:
-				return Math.ceil(o) == o; // error with NaN
+				return (Math.ceil(o) == o) && isFinite(o);
 			case Float:
 			case Float:
 				return __js__("typeof(o)") == "number";
 				return __js__("typeof(o)") == "number";
 			case Bool:
 			case Bool: