Landing Ben Alman's patch to add nextUntil, prevUntil, and parentsUntil. Also adds some tests for prevAll and nextAll, and fixes an test edge case in parents.

This commit is contained in:
Ben Alman 2009-12-04 12:28:47 -05:00 committed by jeresig
parent bbd933cbfe
commit 2b481b93cf
3 changed files with 98 additions and 11 deletions

View file

@ -484,13 +484,14 @@ jQuery.extend({
return ret;
},
map: function( elems, callback ) {
// arg is for internal usage only
map: function( elems, callback, arg ) {
var ret = [], value;
// Go through the array, translating each of the items to their
// new value (or values).
for ( var i = 0, length = elems.length; i < length; i++ ) {
value = callback( elems[ i ], i );
value = callback( elems[ i ], i, arg );
if ( value != null ) {
ret[ ret.length ] = value;