From e392e5579b9f8f1e20c0befe0577e5141fc45468 Mon Sep 17 00:00:00 2001 From: Oleg Date: Fri, 25 Jan 2013 06:26:16 +0400 Subject: [PATCH] Change variables initialization sequence for some declarations --- src/attributes.js | 2 +- src/callbacks.js | 10 +++++----- src/core.js | 6 +++--- src/event.js | 16 ++++++++-------- src/manipulation.js | 8 ++++---- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/attributes.js b/src/attributes.js index 5aaadb7c4..7d4fd9492 100644 --- a/src/attributes.js +++ b/src/attributes.js @@ -166,7 +166,7 @@ jQuery.fn.extend({ }, val: function( value ) { - var hooks, ret, isFunction, + var ret, hooks, isFunction, elem = this[0]; if ( !arguments.length ) { diff --git a/src/callbacks.js b/src/callbacks.js index 2bb378047..32c22ce59 100644 --- a/src/callbacks.js +++ b/src/callbacks.js @@ -40,18 +40,18 @@ jQuery.Callbacks = function( options ) { ( optionsCache[ options ] || createOptions( options ) ) : jQuery.extend( {}, options ); - var // Last fire value (for non-forgettable lists) + var // Flag to know if list is currently firing + firing, + // Last fire value (for non-forgettable lists) memory, // Flag to know if list was already fired fired, - // Flag to know if list is currently firing - firing, // First callback to fire (used internally by add and fireWith) firingStart, - // End of the loop when firing - firingLength, // Index of currently firing callback (modified by remove if needed) firingIndex, + // End of the loop when firing + firingLength, // Actual callback list list = [], // Stack of fire calls for repeatable lists diff --git a/src/core.js b/src/core.js index 64c9f9cc7..4098f8fef 100644 --- a/src/core.js +++ b/src/core.js @@ -93,7 +93,7 @@ jQuery.fn = jQuery.prototype = { constructor: jQuery, init: function( selector, context, rootjQuery ) { - var match, elem; + var elem, match; // 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 options, name, src, copy, copyIsArray, clone, + var copy, options, src, copyIsArray, name, clone, target = arguments[0] || {}, i = 1, length = arguments.length, @@ -770,7 +770,7 @@ jQuery.extend({ // Bind a function to a context, optionally partially applying any // arguments. proxy: function( fn, context ) { - var tmp, args, proxy; + var args, proxy, tmp; if ( typeof context === "string" ) { tmp = fn[ context ]; diff --git a/src/event.js b/src/event.js index 7b8b77709..c10c684df 100644 --- a/src/event.js +++ b/src/event.js @@ -22,9 +22,9 @@ jQuery.event = { add: function( elem, types, handler, data, selector ) { - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, + var handleObjIn, tmp, eventHandle, + t, handleObj, special, + events, handlers, type, namespaces, origType, elemData = jQuery._data( elem ); // Don't attach events to noData or text/comment nodes (but allow plain objects) @@ -133,8 +133,8 @@ jQuery.event = { // Detach an event or set of events from an element remove: function( elem, types, handler, selector, mappedTypes ) { - var j, origCount, tmp, - events, t, handleObj, + var events, handleObj, tmp, + j, t, origCount, special, handlers, type, namespaces, origType, elemData = jQuery.hasData( elem ) && jQuery._data( elem ); @@ -206,7 +206,7 @@ jQuery.event = { trigger: function( event, data, elem, onlyHandlers ) { - var i, cur, tmp, bubbleType, ontype, handle, special, + var i, handle, ontype, bubbleType, tmp, special, cur, eventPath = [ elem || document ], type = event.type || event, namespaces = event.namespace ? event.namespace.split(".") : []; @@ -343,7 +343,7 @@ jQuery.event = { // Make a writable jQuery.Event from the native event object event = jQuery.event.fix( event ); - var i, j, ret, matched, handleObj, + var ret, j, handleObj, matched, i, handlerQueue = [], args = core_slice.call( arguments ), handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], @@ -876,7 +876,7 @@ if ( !jQuery.support.focusinBubbles ) { jQuery.fn.extend({ on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var origFn, type; + var type, origFn; // Types can be a map of types/handlers if ( typeof types === "object" ) { diff --git a/src/manipulation.js b/src/manipulation.js index 569a71d83..b947df8e9 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -285,7 +285,7 @@ jQuery.fn.extend({ // Flatten any nested arrays args = core_concat.apply( [], args ); - var fragment, first, scripts, hasScripts, node, doc, + var scripts, node, doc, fragment, hasScripts, first, i = 0, l = this.length, set = this, @@ -559,7 +559,7 @@ function fixDefaultChecked( elem ) { jQuery.extend({ clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, srcElements, node, i, clone, + var clone, node, srcElements, i, destElements, inPage = jQuery.contains( elem.ownerDocument, elem ); if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { @@ -614,7 +614,7 @@ jQuery.extend({ }, buildFragment: function( elems, context, scripts, selection ) { - var contains, elem, tag, tmp, wrap, tbody, j, + var contains, elem, j, tmp, tag, wrap, tbody, l = elems.length, // Ensure a safe fragment @@ -740,7 +740,7 @@ jQuery.extend({ }, cleanData: function( elems, /* internal */ acceptData ) { - var data, id, elem, type, + var elem, id, type, data, i = 0, internalKey = jQuery.expando, cache = jQuery.cache, -- 2.39.5