Landing Ben Alman's patch to add nextUntil, prevUntil, and parentsUntil. Also adds...
[jquery.git] / src / core.js
index e2d3b60..4949d6b 100644 (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;