var winnow = function( elements, qualifier, keep ) {
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function(elem, i) {
- return !!qualifier.call( elem, i ) === keep;
+ return !!qualifier.call( elem, i, elem ) === keep;
});
} else if ( qualifier.nodeType ) {
});
test("filter(Function)", function() {
- expect(1);
+ expect(2);
same( jQuery("p").filter(function() { return !jQuery("a", this).length }).get(), q("sndp", "first"), "filter(Function)" );
+
+ same( jQuery("p").filter(function(i, elem) { return !jQuery("a", elem).length }).get(), q("sndp", "first"), "filter(Function) using arg" );
});
test("filter(Element)", function() {