]> source.dussan.org Git - jquery.git/commitdiff
Fix #14190: Remove unnecessary assignment in .closest. Close gh-1411.
authorMarian Sollmann <marian.sollmann@cargomedia.ch>
Mon, 28 Oct 2013 14:31:58 +0000 (15:31 +0100)
committerRichard Gibson <richard.gibson@gmail.com>
Wed, 6 Nov 2013 15:27:48 +0000 (10:27 -0500)
(cherry picked from commit 346b031af9e3b315ef351a9cc7fee56f930cf346)

Conflicts:

src/traversing.js

src/traversing.js

index 02ea249fe9b0bfe2ee6d5381316a6fed53389471..5dd970f675e045226cd1a203e574b10d9d3b4024 100644 (file)
@@ -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