diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2006-11-29 20:22:29 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2006-11-29 20:22:29 +0000 |
commit | 3ab145e5aaf68fca0973cb3a8a268739729a90d6 (patch) | |
tree | e191b964f3214147379d6e55ab948491df907796 | |
parent | fea94528e2cad2d94e4e642273a5a98eb98c1729 (diff) | |
download | jquery-3ab145e5aaf68fca0973cb3a8a268739729a90d6.tar.gz jquery-3ab145e5aaf68fca0973cb3a8a268739729a90d6.zip |
Added test for filter(Array), fixed bug #446
-rw-r--r-- | src/jquery/coreTest.js | 8 | ||||
-rw-r--r-- | src/jquery/jquery.js | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index 3f674c0b4..7548e6300 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -258,8 +258,9 @@ test("clone()", function() { ok( 'This is a normal link: Yahoo' == $('#en').text(), 'Reassert text for #en' ); }); -test("filter(String)", function() { - isSet( $("input").filter(":checked").get(), q("radio2", "check1"), "Filter elements" ); +test("filter()", function() { + isSet( $("input").filter(":checked").get(), q("radio2", "check1"), "filter(String)" ); + isSet( $("p").filter(["#ap", "#sndp"]).get(), q("ap", "sndp"), "filter(Array<String>)" ); }); test("filter(String) - execute callback in fitting context", function() { @@ -277,7 +278,8 @@ test("filter(String) - execute callback in not-fitting context", function() { }); test("not(String)", function() { - ok($("#main > p#ap > a").not("#google").length == 2, ".not") + ok($("#main > p#ap > a").not("#google").length == 2, "not('selector')") + isSet( $("p").not("#ap, #sndp").get(), q("firstp", "en", "sap", "first", "result"), "not('selector, selector')" ); }); test("is(String)", function() { diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index 0c99d047c..689784a56 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -863,7 +863,7 @@ jQuery.fn = jQuery.prototype = { for ( var i = 0; i < t.length; i++ ) if ( jQuery.filter(t[i],[a]).r.length ) return a; - return false; + return null; }) || t.constructor == Boolean && |