From: jaubourg Date: Mon, 21 Feb 2011 23:44:22 +0000 (+0100) Subject: Makes the promise method of Deferreds a bit more readable by not using the variable... X-Git-Tag: 1.5.1~5 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e405419fb796030f7fee2bb8372eca158f85d849;p=jquery.git Makes the promise method of Deferreds a bit more readable by not using the variable declared as parameter trick anymore. --- diff --git a/src/core.js b/src/core.js index e7efb6556..31330e8f6 100644 --- a/src/core.js +++ b/src/core.js @@ -890,14 +890,14 @@ jQuery.extend({ isRejected: failDeferred.isResolved, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object - promise: function( obj , i /* internal */ ) { + promise: function( obj ) { if ( obj == null ) { if ( promise ) { return promise; } promise = obj = {}; } - i = promiseMethods.length; + var i = promiseMethods.length; while( i-- ) { obj[ promiseMethods[ i ] ] = deferred[ promiseMethods[ i ] ]; }