diff options
author | jaubourg <aubourg.julian@gmail.com> | 2010-12-21 00:56:00 +0100 |
---|---|---|
committer | jaubourg <aubourg.julian@gmail.com> | 2010-12-21 00:56:00 +0100 |
commit | 9e3f053c6568863251da20eba713d05f2bbdf9f0 (patch) | |
tree | 6a3f329ec7024a46c4de1f55029a125d7a50676d | |
parent | 88d97deb773e6142b7656a4bc4ee973957b6ba49 (diff) | |
download | jquery-9e3f053c6568863251da20eba713d05f2bbdf9f0.tar.gz jquery-9e3f053c6568863251da20eba713d05f2bbdf9f0.zip |
Fixed a loop that only worked in webkit.
-rw-r--r-- | src/core.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core.js b/src/core.js index f7713ca82..39d49743c 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 ); } } |