From fd04452db905ddab2b9870da462c7ddd97059dac Mon Sep 17 00:00:00 2001 From: rolux Date: Wed, 13 Jun 2012 00:02:55 +0200 Subject: [PATCH] make sure Ox.isInt(Infinity) returns false --- source/Ox/js/Type.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/Ox/js/Type.js b/source/Ox/js/Type.js index 10e8fedb..0f83224e 100644 --- a/source/Ox/js/Type.js +++ b/source/Ox/js/Type.js @@ -206,9 +206,11 @@ Ox.isInt Tests if a value is an integer true > Ox.isInt(0.5) false + > Ox.isInt(Infinity) + false @*/ Ox.isInt = function(value) { - return value === Math.floor(value); + return isFinite(value) && value === Math.floor(value); }; /*@