Merge "Added a getLazyConnectionRef() function to load balancer"
[lhc/web/wiklou.git] / resources / jquery / jquery.mwExtension.js
index 3757393..de39978 100644 (file)
                        return str.charAt( 0 ).toUpperCase() + str.substr( 1 );
                },
                escapeRE: function ( str ) {
-                       return str.replace ( /([\\{}()|.?*+\-\^$\[\]])/g, "\\$1" );
+                       return str.replace ( /([\\{}()|.?*+\-\^$\[\]])/g, '\\$1' );
                },
                isDomElement: function ( el ) {
                        return !!el && !!el.nodeType;
                },
                isEmpty: function ( v ) {
+                       var key;
                        if ( v === '' || v === 0 || v === '0' || v === null
                                || v === false || v === undefined )
                        {
@@ -32,7 +33,7 @@
                                return true;
                        }
                        if ( typeof v === 'object' ) {
-                               for ( var key in v ) {
+                               for ( key in v ) {
                                        return false;
                                }
                                return true;
@@ -55,6 +56,7 @@
                        return true;
                },
                compareObject: function ( objectA, objectB ) {
+                       var prop, type;
 
                        // Do a simple check if the types match
                        if ( typeof objectA === typeof objectB ) {
                                        if ( objectA === objectB ) {
                                                return true;
                                        } else {
-                                               var prop;
                                                // Iterate over each property
                                                for ( prop in objectA ) {
                                                        // Check if this property is also present in the other object
                                                        if ( prop in objectB ) {
                                                                // Compare the types of the properties
-                                                               var type = typeof objectA[prop];
+                                                               type = typeof objectA[prop];
                                                                if ( type === typeof objectB[prop] ) {
                                                                        // Recursively check objects inside this one
                                                                        switch ( type ) {