Fixed not(jQuery) (need. more. tests.)
This commit is contained in:
parent
2550b1ea6a
commit
c96b991493
2 changed files with 10 additions and 9 deletions
5
src/jquery/coreTest.js
vendored
5
src/jquery/coreTest.js
vendored
|
@ -494,10 +494,11 @@ test("filter()", function() {
|
||||||
isSet( $("p").filter(function() { return !$("a", this).length }).get(), q("sndp", "first"), "filter(Function)" );
|
isSet( $("p").filter(function() { return !$("a", this).length }).get(), q("sndp", "first"), "filter(Function)" );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("not(String)", function() {
|
test("not()", function() {
|
||||||
expect(2);
|
expect(3);
|
||||||
ok( $("#main > p#ap > a").not("#google").length == 2, "not('selector')" );
|
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('selector, selector')" );
|
||||||
|
isSet( $("p").not($("#ap, #sndp, .result")).get(), q("firstp", "en", "sap", "first"), "not(jQuery)" );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
10
src/jquery/jquery.js
vendored
10
src/jquery/jquery.js
vendored
|
@ -930,11 +930,11 @@ jQuery.fn = jQuery.prototype = {
|
||||||
jQuery.multiFilter(t, this, true) ||
|
jQuery.multiFilter(t, this, true) ||
|
||||||
|
|
||||||
jQuery.grep(this, function(a) {
|
jQuery.grep(this, function(a) {
|
||||||
if ( t.constructor == Array || t.jquery )
|
return ( t.constructor == Array || t.jquery )
|
||||||
return jQuery.inArray( t, a ) < 0;
|
? console.log("t: %o a: %o", t, a) | jQuery.inArray( a, t ) < 0
|
||||||
else
|
: a != t;
|
||||||
return a != t;
|
})
|
||||||
}) );
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue