]> source.dussan.org Git - jquery.git/commitdiff
Makes the promise method of Deferreds a bit more readable by not using the variable...
authorjaubourg <j@ubourg.net>
Mon, 21 Feb 2011 23:44:22 +0000 (00:44 +0100)
committerjaubourg <j@ubourg.net>
Mon, 21 Feb 2011 23:44:22 +0000 (00:44 +0100)
src/core.js

index e7efb655612b90f4f38bdedddbff5f2ec9f10f7e..31330e8f6b258f347c92af1514c3fd28c7fcc626 100644 (file)
@@ -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 ] ];
                                }