From 90b25efa6c3c3676c5ae1dd782d04726e03a31e8 Mon Sep 17 00:00:00 2001 From: David Serduke Date: Mon, 17 Dec 2007 16:54:44 +0000 Subject: 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. --- src/core.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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; }); }, -- cgit v1.2.3