aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjaubourg <aubourg.julian@gmail.com>2010-12-21 00:56:00 +0100
committerjaubourg <j@ubourg.net>2010-12-31 03:49:23 +0100
commitc072dbd4e283f2e601b0004920c46d2e6b62f899 (patch)
tree4d880e8e69fee2ae3b2b540733878e19e2895a70 /src
parent5bacb53866dbc3fbb36202a25c756a4ea2fd5965 (diff)
downloadjquery-c072dbd4e283f2e601b0004920c46d2e6b62f899.tar.gz
jquery-c072dbd4e283f2e601b0004920c46d2e6b62f899.zip
Fixed a loop that only worked in webkit.
Diffstat (limited to 'src')
-rw-r--r--src/core.js14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core.js b/src/core.js
index d41b9a9b6..d141c4d69 100644
--- a/src/core.js
+++ b/src/core.js
@@ -800,12 +800,14 @@ jQuery.extend({
deferred = {
// then( f1, f2, ...)
- then: function() {
+ then: function then() {
if ( ! cancelled ) {
var args = arguments,
i,
+ length,
+ elem,
type,
_fired;
@@ -814,13 +816,13 @@ jQuery.extend({
fired = 0;
}
- for ( i in args ) {
- i = args[ i ];
- type = jQuery.type( i );
+ for ( i = 0, length = args.length ; i < length ; i++ ) {
+ elem = args[ i ];
+ type = jQuery.type( elem );
if ( type === "array" ) {
- this.then.apply( this , i );
+ then.apply( this , elem );
} else if ( type === "function" ) {
- callbacks.push( i );
+ callbacks.push( elem );
}
}