From 9e3f053c6568863251da20eba713d05f2bbdf9f0 Mon Sep 17 00:00:00 2001
From: jaubourg <aubourg.julian@gmail.com>
Date: Tue, 21 Dec 2010 00:56:00 +0100
Subject: [PATCH] Fixed a loop that only worked in webkit.

---
 src/core.js |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

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 );
 							}
 						}
 						
-- 
1.7.10.4