stricter ECMA5 compliance. _.every now requires an iterator to be passed. #160

This commit is contained in:
Jeremy Ashkenas
2011-04-15 17:17:54 -04:00
parent 3df562f07e
commit bf214d2c8d
2 changed files with 4 additions and 5 deletions

View File

@@ -168,7 +168,6 @@
// Delegates to **ECMAScript 5**'s native `every` if available.
// Aliased as `all`.
_.every = _.all = function(obj, iterator, context) {
iterator || (iterator = _.identity);
var result = true;
if (obj == null) return result;
if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);