Skip to content
Permalink
Browse files

Added support for comma-separated .is(), touched up the test cases. R…

…esolves #977.
  • Loading branch information
jeresig committed Mar 24, 2007
1 parent 6d03f92 commit e2b52e1e401af05a6fe3ca7bf9e714f973fc4d61
Showing with 5 additions and 5 deletions.
  1. +4 −4 src/jquery/coreTest.js
  2. +1 −1 src/jquery/jquery.js
@@ -576,10 +576,10 @@ test("is(String)", function() {
ok( !$('#foo').is(undefined), 'Expected false for an invalid expression - undefined' );

// test is() with comma-seperated expressions
ok( $('#en').is('[@lang="en"],[@lang="de"]'), 'Check for lang attribute: Expecte en or de' );
ok( $('#en').is('[@lang="de"],[@lang="en"]'), 'Check for lang attribute: Expecte en or de' );
ok( $('#en').is('[@lang="en"] , [@lang="de"]'), 'Check for lang attribute: Expecte en or de' );
ok( $('#en').is('[@lang="de"] , [@lang="en"]'), 'Check for lang attribute: Expecte en or de' );
ok( $('#en').is('[@lang="en"],[@lang="de"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' );
ok( $('#en').is('[@lang="de"],[@lang="en"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' );
ok( $('#en').is('[@lang="en"] , [@lang="de"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' );
ok( $('#en').is('[@lang="de"] , [@lang="en"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' );
});

test("$.extend(Object, Object)", function() {
@@ -1041,7 +1041,7 @@ jQuery.fn = jQuery.prototype = {
* @cat DOM/Traversing
*/
is: function(expr) {
return expr ? jQuery.filter(expr,this).r.length > 0 : false;
return expr ? jQuery.multiFilter(expr,this).length > 0 : false;
},

/**

0 comments on commit e2b52e1

Please sign in to comment.
You can’t perform that action at this time.