]> source.dussan.org Git - jquery.git/commitdiff
Fix #13355. Tweak Uglify options and var order for gzip. Close gh-1151.
authorOleg <markelog@gmail.com>
Tue, 29 Jan 2013 00:04:58 +0000 (04:04 +0400)
committerDave Methvin <dave.methvin@gmail.com>
Thu, 31 Jan 2013 15:22:12 +0000 (10:22 -0500)
Change uglify-js options for compressor
Change variables initialization sequence for some declarations

12 files changed:
Gruntfile.js
src/ajax.js
src/ajax/xhr.js
src/attributes.js
src/callbacks.js
src/core.js
src/css.js
src/data.js
src/effects.js
src/event.js
src/manipulation.js
src/support.js

index 5d72c24ad9c34824ede3febe23d6a4bb3a2c2a52..4058871d510a93e4db3160a3706fae33cc3038ea 100644 (file)
@@ -101,6 +101,12 @@ module.exports = function( grunt ) {
                                options: {
                                        banner: "/*! jQuery v<%= pkg.version %> | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license */",
                                        sourceMap: "dist/jquery.min.map",
+                                       compress: {
+                                               hoist_funs: false,
+                                               join_vars: false,
+                                               loops: false,
+                                               unused: false
+                                       },
                                        beautify: {
                                                ascii_only: true
                                        }
index a7508e9721da92558e9cca4e324ae6b905f54733..04c7e0208a19f72168e4afce1d90694cc3e8b10d 100644 (file)
@@ -2,7 +2,6 @@ var
        // Document location
        ajaxLocParts,
        ajaxLocation,
-       
        ajax_nonce = jQuery.now(),
 
        ajax_rquery = /\?/,
@@ -115,7 +114,7 @@ function inspectPrefiltersOrTransports( structure, options, originalOptions, jqX
 // that takes "flat" options (not to be deep extended)
 // Fixes #9887
 function ajaxExtend( target, src ) {
-       var key, deep,
+       var deep, key,
                flatOptions = jQuery.ajaxSettings.flatOptions || {};
 
        for ( key in src ) {
@@ -135,7 +134,7 @@ jQuery.fn.load = function( url, params, callback ) {
                return _load.apply( this, arguments );
        }
 
-       var selector, type, response,
+       var selector, response, type,
                self = this,
                off = url.indexOf(" ");
 
@@ -316,20 +315,23 @@ jQuery.extend({
                // Force options to be an object
                options = options || {};
 
-               var transport,
+               var // Cross-domain detection vars
+                       parts,
+                       // Loop variable
+                       i,
                        // URL without anti-cache param
                        cacheURL,
-                       // Response headers
+                       // Response headers as string
                        responseHeadersString,
-                       responseHeaders,
                        // timeout handle
                        timeoutTimer,
-                       // Cross-domain detection vars
-                       parts,
+
                        // To know if global events are to be dispatched
                        fireGlobals,
-                       // Loop variable
-                       i,
+
+                       transport,
+                       // Response headers
+                       responseHeaders,
                        // Create the final options object
                        s = jQuery.ajaxSetup( {}, options ),
                        // Callbacks context
@@ -704,8 +706,7 @@ jQuery.extend({
  * - returns the corresponding response
  */
 function ajaxHandleResponses( s, jqXHR, responses ) {
-
-       var ct, type, finalDataType, firstDataType,
+       var firstDataType, ct, finalDataType, type,
                contents = s.contents,
                dataTypes = s.dataTypes,
                responseFields = s.responseFields;
@@ -766,8 +767,7 @@ function ajaxHandleResponses( s, jqXHR, responses ) {
 
 // Chain conversions given the request and the original response
 function ajaxConvert( s, response ) {
-
-       var conv, conv2, current, tmp,
+       var conv2, current, conv, tmp,
                converters = {},
                i = 0,
                // Work with a copy of dataTypes in case we need to modify it for conversion
index 2353392f6a4c8648e5031b6c5b387ef38220d9bf..3133dd4398de62e7f4e881d0f8dc3789767d0e01 100644 (file)
@@ -101,11 +101,7 @@ if ( xhrSupported ) {
 
                                        // Listener
                                        callback = function( _, isAbort ) {
-
-                                               var status,
-                                                       statusText,
-                                                       responseHeaders,
-                                                       responses;
+                                               var status, responseHeaders, statusText, responses;
 
                                                // Firefox throws exceptions when accessing properties
                                                // of an xhr when a network error occurred
index 7d4fd94922d64e7c621c99c7896005e0cae0a686..6902244edf645a6bd678d6f26526d46e52eb0287 100644 (file)
@@ -290,7 +290,7 @@ jQuery.extend({
        },
 
        attr: function( elem, name, value ) {
-               var ret, hooks, notxml,
+               var hooks, notxml, ret,
                        nType = elem.nodeType;
 
                // don't get/set attributes on text, comment and attribute nodes
index 32c22ce59cdd72ed8cc239853e594707d1092434..d94f0b329e21deaa7a21e28c742a943ff02c3918 100644 (file)
@@ -46,12 +46,12 @@ jQuery.Callbacks = function( options ) {
                memory,
                // Flag to know if list was already fired
                fired,
-               // First callback to fire (used internally by add and fireWith)
-               firingStart,
-               // Index of currently firing callback (modified by remove if needed)
-               firingIndex,
                // End of the loop when firing
                firingLength,
+               // Index of currently firing callback (modified by remove if needed)
+               firingIndex,
+               // First callback to fire (used internally by add and fireWith)
+               firingStart,
                // Actual callback list
                list = [],
                // Stack of fire calls for repeatable lists
index 4098f8fef1d67945b8558d17bd19a06ad489bc87..d37056d8ddf7af525870f3a1edc6e039fa9edf02 100644 (file)
@@ -1,10 +1,10 @@
 var
-       // A central reference to the root jQuery(document)
-       rootjQuery,
-
        // The deferred used on DOM ready
        readyList,
 
+       // A central reference to the root jQuery(document)
+       rootjQuery,
+
        // Support: IE<9
        // For `typeof node.method` instead of `node.method !== undefined`
        core_strundefined = typeof undefined,
@@ -93,7 +93,7 @@ jQuery.fn = jQuery.prototype = {
 
        constructor: jQuery,
        init: function( selector, context, rootjQuery ) {
-               var elem, match;
+               var match, elem;
 
                // HANDLE: $(""), $(null), $(undefined), $(false)
                if ( !selector ) {
@@ -288,7 +288,7 @@ jQuery.fn = jQuery.prototype = {
 jQuery.fn.init.prototype = jQuery.fn;
 
 jQuery.extend = jQuery.fn.extend = function() {
-       var copy, options, src, copyIsArray, name, clone,
+       var src, copyIsArray, copy, name, options, clone,
                target = arguments[0] || {},
                i = 1,
                length = arguments.length,
index 57d61925ecce13658f144645c11faa6ce5a22b5b..72a9962d313f09ec41688227e8996a3d21c6cfe1 100644 (file)
@@ -1,4 +1,4 @@
-var curCSS, getStyles, iframe,
+var iframe, getStyles, curCSS,
        ralpha = /alpha\([^)]*\)/i,
        ropacity = /opacity\s*=\s*([^)]*)/,
        rposition = /^(top|right|bottom|left)$/,
@@ -98,7 +98,7 @@ function showHide( elements, show ) {
 jQuery.fn.extend({
        css: function( name, value ) {
                return jQuery.access( this, function( elem, name, value ) {
-                       var styles, len,
+                       var len, styles,
                                map = {},
                                i = 0;
 
@@ -239,7 +239,7 @@ jQuery.extend({
        },
 
        css: function( elem, name, extra, styles ) {
-               var val, num, hooks,
+               var num, val, hooks,
                        origName = jQuery.camelCase( name );
 
                // Make sure that we're working with the right name
index 95aa0dc307ebc958773b83ae016da7ca320ead34..e471df4eaa45b3814be7054cad5f8dfcaeb8333b 100644 (file)
@@ -1,7 +1,7 @@
 var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
        rmultiDash = /([A-Z])/g;
 
-function internalData( elem, name, data, pvt {
+function internalData( elem, name, data, pvt /* Internal Use Only */ ){
        if ( !jQuery.acceptData( elem ) ) {
                return;
        }
@@ -100,8 +100,7 @@ function internalRemoveData( elem, name, pvt ) {
                return;
        }
 
-       var thisCache, i, l,
-
+       var i, l, thisCache,
                isNode = elem.nodeType,
 
                // See jQuery.data for more information
@@ -216,7 +215,7 @@ jQuery.extend({
        _data: function( elem, name, data ) {
                return internalData( elem, name, data, true );
        },
-       
+
        _removeData: function( elem, name ) {
                return internalRemoveData( elem, name, true );
        },
index ce7017ef16df00baccba09b67591d8cc548bf2ef..5cac7d2d8c6e23cf5c67fb9b13bc7b73138fb31f 100644 (file)
@@ -175,7 +175,7 @@ function Animation( elem, properties, options ) {
 }
 
 function propFilter( props, specialEasing ) {
-       var index, name, easing, value, hooks;
+       var value, name, index, easing, hooks;
 
        // camelCase, specialEasing and expand cssHook pass
        for ( index in props ) {
@@ -243,7 +243,9 @@ jQuery.Animation = jQuery.extend( Animation, {
 
 function defaultPrefilter( elem, props, opts ) {
        /*jshint validthis:true */
-       var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
+       var prop, index, length,
+               value, dataShow, toggle,
+               tween, hooks, oldfire,
                anim = this,
                style = elem.style,
                orig = {},
index c10c684df47f45e9326549472291d6e17e295d62..3d085d2ef20a42e190453c1ccb82dc683614f8d0 100644 (file)
@@ -21,10 +21,9 @@ jQuery.event = {
        global: {},
 
        add: function( elem, types, handler, data, selector ) {
-
-               var handleObjIn, tmp, eventHandle,
-                       t, handleObj, special,
-                       events, handlers, type, namespaces, origType,
+               var tmp, events, t, handleObjIn,
+                       special, eventHandle, handleObj,
+                       handlers, type, namespaces, origType,
                        elemData = jQuery._data( elem );
 
                // Don't attach events to noData or text/comment nodes (but allow plain objects)
@@ -132,10 +131,10 @@ jQuery.event = {
 
        // Detach an event or set of events from an element
        remove: function( elem, types, handler, selector, mappedTypes ) {
-
-               var events, handleObj, tmp,
-                       j, t, origCount,
-                       special, handlers, type, namespaces, origType,
+               var j, handleObj, tmp,
+                       origCount, t, events,
+                       special, handlers, type,
+                       namespaces, origType,
                        elemData = jQuery.hasData( elem ) && jQuery._data( elem );
 
                if ( !elemData || !(events = elemData.events) ) {
@@ -205,8 +204,8 @@ jQuery.event = {
        },
 
        trigger: function( event, data, elem, onlyHandlers ) {
-
-               var i, handle, ontype, bubbleType, tmp, special, cur,
+               var handle, ontype, cur,
+                       bubbleType, special, tmp, i,
                        eventPath = [ elem || document ],
                        type = event.type || event,
                        namespaces = event.namespace ? event.namespace.split(".") : [];
@@ -343,7 +342,7 @@ jQuery.event = {
                // Make a writable jQuery.Event from the native event object
                event = jQuery.event.fix( event );
 
-               var ret, j, handleObj, matched, i,
+               var i, ret, handleObj, matched, j,
                        handlerQueue = [],
                        args = core_slice.call( arguments ),
                        handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
@@ -398,7 +397,7 @@ jQuery.event = {
        },
 
        handlers: function( event, handlers ) {
-               var i, matches, sel, handleObj,
+               var sel, handleObj, matches, i,
                        handlerQueue = [],
                        delegateCount = handlers.delegateCount,
                        cur = event.target;
@@ -511,7 +510,7 @@ jQuery.event = {
        mouseHooks: {
                props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
                filter: function( event, original ) {
-                       var eventDoc, doc, body,
+                       var body, eventDoc, doc,
                                button = original.button,
                                fromElement = original.fromElement;
 
index b947df8e9bceea861801bca08c178187d7186e10..3e14c2b5610c27fe6a18e70bb2687ecc0e9014d5 100644 (file)
@@ -285,7 +285,8 @@ jQuery.fn.extend({
                // Flatten any nested arrays
                args = core_concat.apply( [], args );
 
-               var scripts, node, doc, fragment, hasScripts, first,
+               var first, node, hasScripts,
+                       scripts, doc, fragment,
                        i = 0,
                        l = this.length,
                        set = this,
@@ -436,7 +437,7 @@ function cloneCopyEvent( src, dest ) {
 }
 
 function fixCloneNodeIssues( src, dest ) {
-       var nodeName, data, e;
+       var nodeName, e, data;
 
        // We do not need to do anything for non-Elements
        if ( dest.nodeType !== 1 ) {
@@ -559,7 +560,7 @@ function fixDefaultChecked( elem ) {
 
 jQuery.extend({
        clone: function( elem, dataAndEvents, deepDataAndEvents ) {
-               var clone, node, srcElements, i, destElements,
+               var destElements, node, clone, i, srcElements,
                        inPage = jQuery.contains( elem.ownerDocument, elem );
 
                if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
@@ -614,7 +615,8 @@ jQuery.extend({
        },
 
        buildFragment: function( elems, context, scripts, selection ) {
-               var contains, elem, j, tmp, tag, wrap, tbody,
+               var j, elem, contains,
+                       tmp, tag, tbody, wrap,
                        l = elems.length,
 
                        // Ensure a safe fragment
@@ -740,7 +742,7 @@ jQuery.extend({
        },
 
        cleanData: function( elems, /* internal */ acceptData ) {
-               var elem, id, type, data,
+               var elem, type, id, data,
                        i = 0,
                        internalKey = jQuery.expando,
                        cache = jQuery.cache,
index 09f894c70072730ae66ea2485f19db666231fed4..6e755b55ddceab714d63209448102d8d1e813133 100644 (file)
@@ -1,6 +1,8 @@
 jQuery.support = (function() {
 
-       var support, all, a, select, opt, input, fragment, eventName, isSupported, i,
+       var support, all, a,
+               input, select, fragment,
+               opt, eventName, isSupported, i,
                div = document.createElement("div");
 
        // Setup