aboutsummaryrefslogtreecommitdiffstats
path: root/src/traversing.js
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2012-07-27 18:19:01 -0400
committerTimmy Willison <timmywillisn@gmail.com>2012-07-27 18:19:18 -0400
commite07b444dfe87f26f0d6031920026142425505ad6 (patch)
treeab6f77aea11aef07f78dde727ff25eea9b8d7c9e /src/traversing.js
parent4039d3668decade6c7098f7f270c45dd54ff6a8c (diff)
downloadjquery-e07b444dfe87f26f0d6031920026142425505ad6.tar.gz
jquery-e07b444dfe87f26f0d6031920026142425505ad6.zip
Fix a regression where has with multiple contexts was not filtering correctly. Test added.
Diffstat (limited to 'src/traversing.js')
-rw-r--r--src/traversing.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/traversing.js b/src/traversing.js
index 8685ae017..4c58ae0b8 100644
--- a/src/traversing.js
+++ b/src/traversing.js
@@ -48,12 +48,12 @@ jQuery.fn.extend({
},
has: function( target ) {
- var i = 0,
+ var i,
targets = jQuery( target, this ),
- l = targets.length;
+ len = targets.length;
return this.filter(function() {
- for ( ; i < l; i++ ) {
+ for ( i = 0; i < len; i++ ) {
if ( jQuery.contains( this, targets[i] ) ) {
return true;
}