Skip to content
Permalink
Browse files

Fixed a loop that only worked in webkit.

  • Loading branch information...
jaubourg authored and jaubourg committed Dec 20, 2010
1 parent 5bacb53 commit c072dbd4e283f2e601b0004920c46d2e6b62f899
Showing with 8 additions and 6 deletions.
  1. +8 −6 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 );
}
}

0 comments on commit c072dbd

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.