aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Serduke <davidserduke@gmail.com>2007-12-17 21:02:05 +0000
committerDavid Serduke <davidserduke@gmail.com>2007-12-17 21:02:05 +0000
commit24e036c7c88e7e3a1f878292e4b59914e1f4575c (patch)
treea0f73dd524cd5f73ddf1b0886a4de8bf47bacd48 /src
parentd1b9ad3cdb3fd226d4208ae6eaed98baf7026222 (diff)
downloadjquery-24e036c7c88e7e3a1f878292e4b59914e1f4575c.tar.gz
jquery-24e036c7c88e7e3a1f878292e4b59914e1f4575c.zip
Fixed #2070 by adding a test for !nodeType to isArrayLike so DOM elements like SELECT are not considered array-like (even though they really are).
Diffstat (limited to 'src')
-rw-r--r--src/core.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core.js b/src/core.js
index 1ec8de057..1e4f92490 100644
--- a/src/core.js
+++ b/src/core.js
@@ -352,11 +352,9 @@ jQuery.fn = jQuery.prototype = {
else
selector = jQuery.multiFilter( selector, this );
+ var isArrayLike = selector.length && selector[selector.length - 1] !== undefined && !selector.nodeType;
return this.filter(function() {
- // 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;
+ return isArrayLike ? jQuery.inArray( this, selector ) < 0 : this != selector;
});
},