Ensure _.times floors n float values.

This commit is contained in:
jdalton
2015-04-15 19:20:41 -07:00
parent 80d892c744
commit 0b20d89d62
2 changed files with 6 additions and 1 deletions

View File

@@ -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)`.

View File

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