X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=39d49743c0c9436c35834c730c70c39487ed3db1;hb=56628c7adffb4b5436257255f55e31b85b58aa8f;hp=f7713ca8215dd101e6021f8198a668833eb9be35;hpb=116c82b027a03a7a5670fa580fa9af819cc1cc03;p=jquery.git diff --git a/src/core.js b/src/core.js index f7713ca..39d4974 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 ); } }