reverted _.buildLookup, restoring _.without to it's previous implementation, adding a test for object identity

This commit is contained in:
Jeremy Ashkenas
2010-02-24 12:53:35 -05:00
parent 412d2e4486
commit d7acbca2ce
4 changed files with 7 additions and 28 deletions

View File

@@ -46,6 +46,10 @@ $(document).ready(function() {
equals(_.without(list, 0, 1).join(', '), '2, 3, 4', 'can remove all instances of an object');
var result = (function(){ return _.without(arguments, 0, 1); })(1, 2, 1, 0, 3, 1, 4);
equals(result.join(', '), '2, 3, 4', 'works on an arguments object');
var list = [{one : 1}, {two : 2}];
ok(_.without(list, {one : 1}).length == 2, 'uses real object identity for comparisons.');
ok(_.without(list, list[0]).length == 1, 'ditto.');
});
test("arrays: uniq", function() {