diff --git a/lodash.src.js b/lodash.src.js index c96d2b290..49e099755 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -11651,7 +11651,7 @@ * // => also invokes `mage.castSpell(n)` three times */ function times(n, iteratee, thisArg) { - n = +n; + n = floor(n); // Exit early to avoid a JSC JIT bug in Safari 8 // where `Array(0)` is treated as `Array(1)`. diff --git a/test/test.js b/test/test.js index 624f726b9..35367f035 100644 --- a/test/test.js +++ b/test/test.js @@ -15544,6 +15544,11 @@ }); }); + test('should floor `n` float values', 1, function() { + var actual = _.times(2.4, _.indentify); + deepEqual(actual, [0, 1]); + }); + test('should provide the correct `iteratee` arguments', 1, function() { var args;