Skip to content

Commit

Permalink
Stop using reserved words as argument names, closes gh-841.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesherov authored and dmethvin committed Jul 6, 2012
2 parents 1793eab + a69fbba commit 7532bd7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
46 changes: 23 additions & 23 deletions src/core.js
Expand Up @@ -564,21 +564,21 @@ jQuery.extend({
}, },


// args is for internal usage only // args is for internal usage only
each: function( object, callback, args ) { each: function( obj, callback, args ) {
var name, i = 0, var name, i = 0,
length = object.length, length = obj.length,
isObj = length === undefined || jQuery.isFunction( object ); isObj = length === undefined || jQuery.isFunction( obj );


if ( args ) { if ( args ) {
if ( isObj ) { if ( isObj ) {
for ( name in object ) { for ( name in obj ) {
if ( callback.apply( object[ name ], args ) === false ) { if ( callback.apply( obj[ name ], args ) === false ) {
break; break;
} }
} }
} else { } else {
for ( ; i < length; ) { for ( ; i < length; ) {
if ( callback.apply( object[ i++ ], args ) === false ) { if ( callback.apply( obj[ i++ ], args ) === false ) {
break; break;
} }
} }
Expand All @@ -587,21 +587,21 @@ jQuery.extend({
// A special, fast, case for the most common use of each // A special, fast, case for the most common use of each
} else { } else {
if ( isObj ) { if ( isObj ) {
for ( name in object ) { for ( name in obj ) {
if ( callback.call( object[ name ], name, object[ name ] ) === false ) { if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) {
break; break;
} }
} }
} else { } else {
for ( ; i < length; ) { for ( ; i < length; ) {
if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) {
break; break;
} }
} }
} }
} }


return object; return obj;
}, },


// Use native String.trim function wherever possible // Use native String.trim function wherever possible
Expand All @@ -620,38 +620,38 @@ jQuery.extend({
}, },


// results is for internal usage only // results is for internal usage only
makeArray: function( array, results ) { makeArray: function( arr, results ) {
var ret = results || []; var ret = results || [];


if ( array != null ) { if ( arr != null ) {
// The window, strings (and functions) also have 'length' // The window, strings (and functions) also have 'length'
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
var type = jQuery.type( array ); var type = jQuery.type( arr );


if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) {
core_push.call( ret, array ); core_push.call( ret, arr );
} else { } else {
jQuery.merge( ret, array ); jQuery.merge( ret, arr );
} }
} }


return ret; return ret;
}, },


inArray: function( elem, array, i ) { inArray: function( elem, arr, i ) {
var len; var len;


if ( array ) { if ( arr ) {
if ( core_indexOf ) { if ( core_indexOf ) {
return core_indexOf.call( array, elem, i ); return core_indexOf.call( arr, elem, i );
} }


len = array.length; len = arr.length;
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;


for ( ; i < len; i++ ) { for ( ; i < len; i++ ) {
// Skip accessing in sparse arrays // Skip accessing in sparse arrays
if ( i in array && array[ i ] === elem ) { if ( i in arr && arr[ i ] === elem ) {
return i; return i;
} }
} }
Expand Down Expand Up @@ -817,7 +817,7 @@ jQuery.extend({
} }
}); });


jQuery.ready.promise = function( object ) { jQuery.ready.promise = function( obj ) {
if ( !readyList ) { if ( !readyList ) {


readyList = jQuery.Deferred(); readyList = jQuery.Deferred();
Expand Down Expand Up @@ -871,7 +871,7 @@ jQuery.ready.promise = function( object ) {
} }
} }
} }
return readyList.promise( object ); return readyList.promise( obj );
}; };


// Populate the class2type map // Populate the class2type map
Expand Down
6 changes: 3 additions & 3 deletions src/queue.js
Expand Up @@ -112,7 +112,7 @@ jQuery.fn.extend({
}, },
// Get a promise resolved when queues of a certain type // Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default) // are emptied (fx is the type by default)
promise: function( type, object ) { promise: function( type, obj ) {
var tmp, var tmp,
count = 1, count = 1,
defer = jQuery.Deferred(), defer = jQuery.Deferred(),
Expand All @@ -125,7 +125,7 @@ jQuery.fn.extend({
}; };


if ( typeof type !== "string" ) { if ( typeof type !== "string" ) {
object = type; obj = type;
type = undefined; type = undefined;
} }
type = type || "fx"; type = type || "fx";
Expand All @@ -137,6 +137,6 @@ jQuery.fn.extend({
} }
} }
resolve(); resolve();
return defer.promise( object ); return defer.promise( obj );
} }
}); });

0 comments on commit 7532bd7

Please sign in to comment.