aboutsummaryrefslogtreecommitdiffstats
path: root/src/traversing.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/traversing.js')
-rw-r--r--src/traversing.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/traversing.js b/src/traversing.js
index 90601df55..f8d08fa9a 100644
--- a/src/traversing.js
+++ b/src/traversing.js
@@ -60,7 +60,8 @@ jQuery.fn.extend({
},
is: function( selector ) {
- return !!selector && jQuery.filter( selector, this ).length > 0;
+ return !!selector && (typeof selector === "string" ? jQuery.filter( selector, this ).length > 0 :
+ this.filter( selector ).length > 0);
},
closest: function( selectors, context ) {
@@ -286,7 +287,7 @@ function winnow( elements, qualifier, keep ) {
return retVal === keep;
});
- } else if ( qualifier.nodeType ) {
+ } else if ( qualifier && qualifier.nodeType ) {
return jQuery.grep(elements, function( elem, i ) {
return (elem === qualifier) === keep;
});