mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Fix #14190: Remove unnecessary assignment in .closest. Close gh-1411.
(cherry picked from commit 346b031af9e3b315ef351a9cc7fee56f930cf346) Conflicts: src/traversing.js
This commit is contained in:
parent
90d9c4632c
commit
3c968ce65d
@ -61,7 +61,7 @@ jQuery.fn.extend({
|
||||
var cur,
|
||||
i = 0,
|
||||
l = this.length,
|
||||
ret = [],
|
||||
matched = [],
|
||||
pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
|
||||
jQuery( selectors, context || this.context ) :
|
||||
0;
|
||||
@ -76,13 +76,13 @@ jQuery.fn.extend({
|
||||
cur.nodeType === 1 &&
|
||||
jQuery.find.matchesSelector(cur, selectors)) ) {
|
||||
|
||||
cur = ret.push( cur );
|
||||
matched.push( cur );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
|
||||
return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
|
||||
},
|
||||
|
||||
// Determine the position of an element within
|
||||
|
Loading…
Reference in New Issue
Block a user