Update vendor/underscore.

Former-commit-id: 5ede87579d9b7a8e505da23fc3a4531be40a151b
This commit is contained in:
John-David Dalton
2012-10-13 00:01:29 -07:00
parent bda00bf512
commit 10c87012be
3 changed files with 12 additions and 7 deletions

View File

@@ -177,12 +177,9 @@
// Return all the elements for which a truth test fails.
_.reject = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
each(obj, function(value, index, list) {
if (!iterator.call(context, value, index, list)) results[results.length] = value;
});
return results;
return _.filter(obj, function(value, index, list) {
return !iterator.call(context, value, index, list);
}, context);
};
// Determine whether all of the elements match a truth test.