r94228 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94227‎ | r94228 | r94229 >
Date:03:19, 11 August 2011
Author:krinkle
Status:ok
Tags:
Comment:
Coding style commit
* Colon placement
* Trailing whitespace
* Spaces to tabs
* No need for separate var if it's just a single var (waste of space)
* Strict comparison to undefined
Modified paths:
  • /trunk/phase3/resources/jquery/jquery.mwExtension.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/jquery/jquery.mwExtension.js
@@ -3,26 +3,25 @@
44 */
55
66 jQuery.extend({
7 - trimLeft : function( str ) {
 7+ trimLeft: function( str ) {
88 return str === null ? '' : str.toString().replace( /^\s+/, '' );
99 },
10 - trimRight : function( str ) {
 10+ trimRight: function( str ) {
1111 return str === null ?
1212 '' : str.toString().replace( /\s+$/, '' );
1313 },
14 - ucFirst : function( str ) {
 14+ ucFirst: function( str ) {
1515 return str.substr( 0, 1 ).toUpperCase() + str.substr( 1 );
1616 },
17 - escapeRE : function( str ) {
 17+ escapeRE: function( str ) {
1818 return str.replace ( /([\\{}()|.?*+\-^$\[\]])/g, "\\$1" );
1919 },
20 - isDomElement : function( el ) {
 20+ isDomElement: function( el ) {
2121 return !!el && !!el.nodeType;
2222 },
23 - isEmpty : function( v ) {
24 - var key;
25 - if ( v === "" || v === 0 || v === "0" || v === null
26 - || v === false || typeof v === 'undefined' )
 23+ isEmpty: function( v ) {
 24+ if ( v === '' || v === 0 || v === '0' || v === null
 25+ || v === false || v === undefined )
2726 {
2827 return true;
2928 }
@@ -32,14 +31,14 @@
3332 return true;
3433 }
3534 if ( typeof v === 'object' ) {
36 - for ( key in v ) {
 35+ for ( var key in v ) {
3736 return false;
3837 }
3938 return true;
4039 }
4140 return false;
4241 },
43 - compareArray : function( arrThis, arrAgainst ) {
 42+ compareArray: function( arrThis, arrAgainst ) {
4443 if ( arrThis.length != arrAgainst.length ) {
4544 return false;
4645 }
@@ -54,7 +53,7 @@
5554 }
5655 return true;
5756 },
58 - compareObject : function( objectA, objectB ) {
 57+ compareObject: function( objectA, objectB ) {
5958
6059 // Do a simple check if the types match
6160 if ( typeof objectA == typeof objectB ) {

Status & tagging log