Skip to content

Commit

Permalink
Fix a strange Chrome issue
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Jan 14, 2011
1 parent fa45f25 commit 52a0238
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/traversing.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ jQuery.each({
}
}, function( name, fn ) {
jQuery.fn[ name ] = function( until, selector ) {
var ret = jQuery.map( this, fn, until );
var ret = jQuery.map( this, fn, until ),
args = slice.call(arguments);

if ( !runtil.test( name ) ) {
selector = until;
Expand All @@ -212,7 +213,7 @@ jQuery.each({
ret = ret.reverse();
}

return this.pushStack( ret, name, slice.call(arguments).join(",") );
return this.pushStack( ret, name, args.join(",") );
};
});

Expand Down

8 comments on commit 52a0238

@naholyr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the issue ? It seems it has to be known for any JS developer :)

@jitter
Copy link
Contributor

@jitter jitter commented on 52a0238 Jan 15, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be no test case / ticket associated with this change. Also any information on why this was done is missing.

The only thing I was able to find is a single failing test in the jQuery test suite (before this change) but with the Chrome Dev version (10.something).
In Chrome Stable (8.something) and Chrome Beta (9.something) this change isn't needed.
This strange behavior should be filed as a bug against the Chrome bug tracker as to me it looks like a chrome bug not a jQuery bug.

@paulirish
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is the detail on the Chrome issue: http://code.google.com/p/v8/issues/detail?id=1050

It appeared in the latest dev channel and is live in the chromium nightlies.

We expect to see it fixed soon, so we'll be able to revert this commit once the dev channel comes through with an update.

ajpiano has added a pull req to document this: #186

@yahelc
Copy link

@yahelc yahelc commented on 52a0238 Aug 6, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, the fix came through 6 months ago, but this commit with the "this should be removed" note is still in 1.6.2... Was this forgotten, or is there a reason for keeping it in there?

@paulirish
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ajpiano see above.

@LeadSongDog
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump! Calendar has flipped 4 times through.

@gibson042
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LeadSongDog If you look at the current file, you will see that not only is this code gone, but that there's no longer any remnant of the functionality it was supporting:

jquery/src/traversing.js

Lines 171 to 195 in 9adfad1

jQuery.fn[ name ] = function( until, selector ) {
var matched = jQuery.map( this, fn, until );
if ( name.slice( -5 ) !== "Until" ) {
selector = until;
}
if ( selector && typeof selector === "string" ) {
matched = jQuery.filter( selector, matched );
}
if ( this.length > 1 ) {
// Remove duplicates
if ( !guaranteedUnique[ name ] ) {
jQuery.uniqueSort( matched );
}
// Reverse order for parents* and prev-derivatives
if ( rparentsprev.test( name ) ) {
matched.reverse();
}
}
return this.pushStack( matched );
};

@LeadSongDog
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gibson042 Thanks, I'm still new here and stumbling around.

Please sign in to comment.