Skip to content

Commit 7532bd7

Browse files
mikesherovdmethvin
authored andcommitted
Stop using reserved words as argument names, closes jquerygh-841.
2 parents 1793eab + a69fbba commit 7532bd7

File tree

2 files changed

+26
-26
lines changed

2 files changed

+26
-26
lines changed

src/core.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -564,21 +564,21 @@ jQuery.extend({
564564
},
565565

566566
// args is for internal usage only
567-
each: function( object, callback, args ) {
567+
each: function( obj, callback, args ) {
568568
var name, i = 0,
569-
length = object.length,
570-
isObj = length === undefined || jQuery.isFunction( object );
569+
length = obj.length,
570+
isObj = length === undefined || jQuery.isFunction( obj );
571571

572572
if ( args ) {
573573
if ( isObj ) {
574-
for ( name in object ) {
575-
if ( callback.apply( object[ name ], args ) === false ) {
574+
for ( name in obj ) {
575+
if ( callback.apply( obj[ name ], args ) === false ) {
576576
break;
577577
}
578578
}
579579
} else {
580580
for ( ; i < length; ) {
581-
if ( callback.apply( object[ i++ ], args ) === false ) {
581+
if ( callback.apply( obj[ i++ ], args ) === false ) {
582582
break;
583583
}
584584
}
@@ -587,21 +587,21 @@ jQuery.extend({
587587
// A special, fast, case for the most common use of each
588588
} else {
589589
if ( isObj ) {
590-
for ( name in object ) {
591-
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
590+
for ( name in obj ) {
591+
if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) {
592592
break;
593593
}
594594
}
595595
} else {
596596
for ( ; i < length; ) {
597-
if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
597+
if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) {
598598
break;
599599
}
600600
}
601601
}
602602
}
603603

604-
return object;
604+
return obj;
605605
},
606606

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

622622
// results is for internal usage only
623-
makeArray: function( array, results ) {
623+
makeArray: function( arr, results ) {
624624
var ret = results || [];
625625

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

631-
if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
632-
core_push.call( ret, array );
631+
if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) {
632+
core_push.call( ret, arr );
633633
} else {
634-
jQuery.merge( ret, array );
634+
jQuery.merge( ret, arr );
635635
}
636636
}
637637

638638
return ret;
639639
},
640640

641-
inArray: function( elem, array, i ) {
641+
inArray: function( elem, arr, i ) {
642642
var len;
643643

644-
if ( array ) {
644+
if ( arr ) {
645645
if ( core_indexOf ) {
646-
return core_indexOf.call( array, elem, i );
646+
return core_indexOf.call( arr, elem, i );
647647
}
648648

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

652652
for ( ; i < len; i++ ) {
653653
// Skip accessing in sparse arrays
654-
if ( i in array && array[ i ] === elem ) {
654+
if ( i in arr && arr[ i ] === elem ) {
655655
return i;
656656
}
657657
}
@@ -817,7 +817,7 @@ jQuery.extend({
817817
}
818818
});
819819

820-
jQuery.ready.promise = function( object ) {
820+
jQuery.ready.promise = function( obj ) {
821821
if ( !readyList ) {
822822

823823
readyList = jQuery.Deferred();
@@ -871,7 +871,7 @@ jQuery.ready.promise = function( object ) {
871871
}
872872
}
873873
}
874-
return readyList.promise( object );
874+
return readyList.promise( obj );
875875
};
876876

877877
// Populate the class2type map

src/queue.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jQuery.fn.extend({
112112
},
113113
// Get a promise resolved when queues of a certain type
114114
// are emptied (fx is the type by default)
115-
promise: function( type, object ) {
115+
promise: function( type, obj ) {
116116
var tmp,
117117
count = 1,
118118
defer = jQuery.Deferred(),
@@ -125,7 +125,7 @@ jQuery.fn.extend({
125125
};
126126

127127
if ( typeof type !== "string" ) {
128-
object = type;
128+
obj = type;
129129
type = undefined;
130130
}
131131
type = type || "fx";
@@ -137,6 +137,6 @@ jQuery.fn.extend({
137137
}
138138
}
139139
resolve();
140-
return defer.promise( object );
140+
return defer.promise( obj );
141141
}
142142
});

0 commit comments

Comments
 (0)