Fix a regression where has with multiple contexts was not filtering correctly. Test added.

This commit is contained in:
Timmy Willison
2012-07-27 18:19:01 -04:00
parent 4039d3668d
commit e07b444dfe
2 changed files with 8 additions and 5 deletions

View File

@@ -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;
}