Skip to content
Permalink
Browse files
Fixed not(jQuery) (need. more. tests.)
  • Loading branch information
jzaefferer committed Jan 23, 2007
1 parent 2550b1e commit c96b991493b3e432fe095a18cab29b046577976c
Showing with 11 additions and 10 deletions.
  1. +3 −2 src/jquery/coreTest.js
  2. +8 −8 src/jquery/jquery.js
@@ -494,10 +494,11 @@ test("filter()", function() {
isSet( $("p").filter(function() { return !$("a", this).length }).get(), q("sndp", "first"), "filter(Function)" );
});

test("not(String)", function() {
expect(2);
test("not()", function() {
expect(3);
ok( $("#main > p#ap > a").not("#google").length == 2, "not('selector')" );
isSet( $("p").not("#ap, #sndp, .result").get(), q("firstp", "en", "sap", "first"), "not('selector, selector')" );
isSet( $("p").not($("#ap, #sndp, .result")).get(), q("firstp", "en", "sap", "first"), "not(jQuery)" );
});


@@ -927,14 +927,14 @@ jQuery.fn = jQuery.prototype = {
not: function(t) {
return this.pushStack(
t.constructor == String &&
jQuery.multiFilter(t,this,true) ||

jQuery.grep(this,function(a){
if ( t.constructor == Array || t.jquery )
return jQuery.inArray( t, a ) < 0;
else
return a != t;
}) );
jQuery.multiFilter(t, this, true) ||

jQuery.grep(this, function(a) {
return ( t.constructor == Array || t.jquery )
? console.log("t: %o a: %o", t, a) | jQuery.inArray( a, t ) < 0
: a != t;
})
);
},

/**

0 comments on commit c96b991

Please sign in to comment.