stop using reserved words as argument names

This commit is contained in:
Mike Sherov 2012-06-28 21:39:58 -04:00
parent 304eebb260
commit a69fbbaa8b
2 changed files with 26 additions and 26 deletions

View File

@ -538,21 +538,21 @@ jQuery.extend({
},
// args is for internal usage only
each: function( object, callback, args ) {
each: function( obj, callback, args ) {
var name, i = 0,
length = object.length,
isObj = length === undefined || jQuery.isFunction( object );
length = obj.length,
isObj = length === undefined || jQuery.isFunction( obj );
if ( args ) {
if ( isObj ) {
for ( name in object ) {
if ( callback.apply( object[ name ], args ) === false ) {
for ( name in obj ) {
if ( callback.apply( obj[ name ], args ) === false ) {
break;
}
}
} else {
for ( ; i < length; ) {
if ( callback.apply( object[ i++ ], args ) === false ) {
if ( callback.apply( obj[ i++ ], args ) === false ) {
break;
}
}
@ -561,21 +561,21 @@ jQuery.extend({
// A special, fast, case for the most common use of each
} else {
if ( isObj ) {
for ( name in object ) {
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
for ( name in obj ) {
if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) {
break;
}
}
} else {
for ( ; i < length; ) {
if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) {
break;
}
}
}
}
return object;
return obj;
},
// Use native String.trim function wherever possible
@ -594,38 +594,38 @@ jQuery.extend({
},
// results is for internal usage only
makeArray: function( array, results ) {
makeArray: function( arr, results ) {
var ret = results || [];
if ( array != null ) {
if ( arr != null ) {
// The window, strings (and functions) also have 'length'
// 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 ) ) {
core_push.call( ret, array );
if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) {
core_push.call( ret, arr );
} else {
jQuery.merge( ret, array );
jQuery.merge( ret, arr );
}
}
return ret;
},
inArray: function( elem, array, i ) {
inArray: function( elem, arr, i ) {
var len;
if ( array ) {
if ( arr ) {
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;
for ( ; i < len; i++ ) {
// Skip accessing in sparse arrays
if ( i in array && array[ i ] === elem ) {
if ( i in arr && arr[ i ] === elem ) {
return i;
}
}
@ -812,7 +812,7 @@ jQuery.extend({
}
});
jQuery.ready.promise = function( object ) {
jQuery.ready.promise = function( obj ) {
if ( !readyList ) {
readyList = jQuery.Deferred();
@ -866,7 +866,7 @@ jQuery.ready.promise = function( object ) {
}
}
}
return readyList.promise( object );
return readyList.promise( obj );
};
// Populate the class2type map

View File

@ -112,7 +112,7 @@ jQuery.fn.extend({
},
// Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
promise: function( type, object ) {
promise: function( type, obj ) {
var tmp,
count = 1,
defer = jQuery.Deferred(),
@ -125,7 +125,7 @@ jQuery.fn.extend({
};
if ( typeof type !== "string" ) {
object = type;
obj = type;
type = undefined;
}
type = type || "fx";
@ -137,6 +137,6 @@ jQuery.fn.extend({
}
}
resolve();
return defer.promise( object );
return defer.promise( obj );
}
});