mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
stop using reserved words as argument names
This commit is contained in:
parent
304eebb260
commit
a69fbbaa8b
46
src/core.js
46
src/core.js
@ -538,21 +538,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -561,21 +561,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
|
||||||
@ -594,38 +594,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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -812,7 +812,7 @@ jQuery.extend({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jQuery.ready.promise = function( object ) {
|
jQuery.ready.promise = function( obj ) {
|
||||||
if ( !readyList ) {
|
if ( !readyList ) {
|
||||||
|
|
||||||
readyList = jQuery.Deferred();
|
readyList = jQuery.Deferred();
|
||||||
@ -866,7 +866,7 @@ jQuery.ready.promise = function( object ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return readyList.promise( object );
|
return readyList.promise( obj );
|
||||||
};
|
};
|
||||||
|
|
||||||
// Populate the class2type map
|
// Populate the class2type map
|
||||||
|
@ -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(),
|
||||||
@ -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";
|
||||||
@ -137,6 +137,6 @@ jQuery.fn.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
resolve();
|
resolve();
|
||||||
return defer.promise( object );
|
return defer.promise( obj );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user