From 212eea9cf535e1c340bb14fe03844733b6e40d89 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Wed, 12 Nov 2014 21:56:44 -0800 Subject: [PATCH] Avoid JIT bug in Safari 8. --- lodash.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index c8e4fae33..320b61b54 100644 --- a/lodash.js +++ b/lodash.js @@ -9836,7 +9836,10 @@ * // => also invokes `mage.castSpell(n)` three times */ function times(n, iteratee, thisArg) { - n = nativeIsFinite(n = +n) && n > -1 ? n : 0; + n = +n; + if (n < 1 || !nativeIsFinite(n)) { + return []; + } iteratee = baseCallback(iteratee, thisArg, 1); var index = -1,