]> source.dussan.org Git - jquery.git/commitdiff
Core styleguide cleanup. Fixes #10586 564/head
authorRick Waldron <waldron.rick@gmail.com>
Wed, 26 Oct 2011 18:58:05 +0000 (14:58 -0400)
committerRick Waldron <waldron.rick@gmail.com>
Wed, 26 Oct 2011 18:58:05 +0000 (14:58 -0400)
src/ajax.js
src/deferred.js

index 47aaf192fabab5d9d1adea76645bec0b41496ce5..3736a7431157ecf134b7a07aba5c26e4675d191a 100644 (file)
@@ -82,7 +82,7 @@ function addToPrefiltersOrTransports( structure ) {
                                placeBefore;
 
                        // For each dataType in the dataTypeExpression
-                       for(; i < length; i++ ) {
+                       for ( ; i < length; i++ ) {
                                dataType = dataTypes[ i ];
                                // We control if we're asked to add before
                                // any existing element
@@ -113,7 +113,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
                executeOnly = ( structure === prefilters ),
                selection;
 
-       for(; i < length && ( executeOnly || !selection ); i++ ) {
+       for ( ; i < length && ( executeOnly || !selection ); i++ ) {
                selection = list[ i ]( options, originalOptions, jqXHR );
                // If we got redirected to another dataType
                // we try there if executing only and not done already
@@ -144,7 +144,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
 function ajaxExtend( target, src ) {
        var key, deep,
                flatOptions = jQuery.ajaxSettings.flatOptions || {};
-       for( key in src ) {
+       for ( key in src ) {
                if ( src[ key ] !== undefined ) {
                        ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
                }
@@ -553,7 +553,7 @@ jQuery.extend({
                                // We extract error from statusText
                                // then normalize statusText and status for non-aborts
                                error = statusText;
-                               if( !statusText || status ) {
+                               if ( !statusText || status ) {
                                        statusText = "error";
                                        if ( status < 0 ) {
                                                status = 0;
@@ -604,7 +604,7 @@ jQuery.extend({
                        if ( map ) {
                                var tmp;
                                if ( state < 2 ) {
-                                       for( tmp in map ) {
+                                       for ( tmp in map ) {
                                                statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
                                        }
                                } else {
@@ -859,7 +859,7 @@ function ajaxHandleResponses( s, jqXHR, responses ) {
                firstDataType;
 
        // Fill responseXXX fields
-       for( type in responseFields ) {
+       for ( type in responseFields ) {
                if ( type in responses ) {
                        jqXHR[ responseFields[type] ] = responses[ type ];
                }
@@ -938,13 +938,13 @@ function ajaxConvert( s, response ) {
                conv2;
 
        // For each dataType in the chain
-       for( i = 1; i < length; i++ ) {
+       for ( i = 1; i < length; i++ ) {
 
                // Create converters map
                // with lowercased keys
                if ( i === 1 ) {
-                       for( key in s.converters ) {
-                               if( typeof key === "string" ) {
+                       for ( key in s.converters ) {
+                               if ( typeof key === "string" ) {
                                        converters[ key.toLowerCase() ] = s.converters[ key ];
                                }
                        }
@@ -955,7 +955,7 @@ function ajaxConvert( s, response ) {
                current = dataTypes[ i ];
 
                // If current is auto dataType, update it to prev
-               if( current === "*" ) {
+               if ( current === "*" ) {
                        current = prev;
                // If no auto and dataTypes are actually different
                } else if ( prev !== "*" && prev !== current ) {
@@ -967,7 +967,7 @@ function ajaxConvert( s, response ) {
                        // If there is no direct converter, search transitively
                        if ( !conv ) {
                                conv2 = undefined;
-                               for( conv1 in converters ) {
+                               for ( conv1 in converters ) {
                                        tmp = conv1.split( " " );
                                        if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
                                                conv2 = converters[ tmp[1] + " " + current ];
index 457bc521f71d869e9147aafa64de5de45bdd3ab8..9444f895f8a5cb633505ea36dda0109b34f36ac7 100644 (file)
@@ -66,7 +66,7 @@ jQuery.extend({
                                        if ( obj == null ) {
                                                obj = promise;
                                        } else {
-                                               for( var key in promise ) {
+                                               for ( var key in promise ) {
                                                        obj[ key ] = promise[ key ];
                                                }
                                        }
@@ -124,7 +124,7 @@ jQuery.extend({
                        };
                }
                if ( length > 1 ) {
-                       for( ; i < length; i++ ) {
+                       for ( ; i < length; i++ ) {
                                if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
                                        args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
                                } else {