aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Serduke <davidserduke@gmail.com>2007-12-17 16:54:44 +0000
committerDavid Serduke <davidserduke@gmail.com>2007-12-17 16:54:44 +0000
commit90b25efa6c3c3676c5ae1dd782d04726e03a31e8 (patch)
tree23678f8f10047cf4c2927310a1ef298454bc649a /src
parentd7f5a0835bc463d15a4f6210e48110054a050f0b (diff)
downloadjquery-90b25efa6c3c3676c5ae1dd782d04726e03a31e8.tar.gz
jquery-90b25efa6c3c3676c5ae1dd782d04726e03a31e8.zip
Fixed #2062 by adding a check to see if the selector is array-like in .not() before testing it as an array. Otherwise it does a straight comparison during the filter test.
Diffstat (limited to 'src')
-rw-r--r--src/core.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core.js b/src/core.js
index c7f30d6de..1ec8de057 100644
--- a/src/core.js
+++ b/src/core.js
@@ -353,7 +353,10 @@ jQuery.fn = jQuery.prototype = {
selector = jQuery.multiFilter( selector, this );
return this.filter(function() {
- return jQuery.inArray( this, selector ) < 0;
+ // check to see if the selector is array-like otherwise assume it is just a DOM element
+ return ( selector.length && selector[selector.length - 1] !== undefined )
+ ? jQuery.inArray( this, selector ) < 0
+ : this != selector;
});
},