From b0d6c345651532172962dc50a7c655860547d15d Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 23 Aug 2015 18:41:11 -0700 Subject: [PATCH] Add `isIterateeCall` checks back to `_.every` and `_.some`. --- lodash.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lodash.js b/lodash.js index be338aa0c..43f717597 100644 --- a/lodash.js +++ b/lodash.js @@ -5878,7 +5878,9 @@ */ function every(collection, predicate, guard) { var func = isArray(collection) ? arrayEvery : baseEvery; - predicate = guard ? undefined : predicate; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } return func(collection, getIteratee(predicate)); } @@ -6513,7 +6515,9 @@ */ function some(collection, predicate, guard) { var func = isArray(collection) ? arraySome : baseSome; - predicate = guard ? undefined : predicate; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } return func(collection, getIteratee(predicate)); }