Skip to content

Commit

Permalink
Switched to using slice instead of join to get the correct results.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeresig committed Dec 4, 2009
1 parent 2b481b9 commit 39a77c2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/traversing.js
Expand Up @@ -2,8 +2,7 @@ var runtil = /Until$/,
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
// Note: This RegExp should be improved, or likely pulled from Sizzle
rmultiselector = /,/,
slice = Array.prototype.slice,
join = Array.prototype.join;
slice = Array.prototype.slice;

// Implement the identical functionality for filter and not
var winnow = function( elements, qualifier, keep ) {
Expand Down Expand Up @@ -138,7 +137,7 @@ jQuery.fn.extend({

slice: function() {
return this.pushStack( slice.apply( this, arguments ),
"slice", join.call(arguments, ",") );
"slice", slice.call(arguments).join(",") );
},

map: function( callback ) {
Expand Down Expand Up @@ -187,7 +186,7 @@ jQuery.each({
ret = ret.reverse();
}

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

Expand Down

0 comments on commit 39a77c2

Please sign in to comment.