r87752 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87751‎ | r87752 | r87753 >
Date:18:22, 9 May 2011
Author:krinkle
Status:ok
Tags:
Comment:
Minor adjustments in UploadWizard/mw.Utilities
* Removing window.mediaWiki > mw alias (already in core)
* Removing typeof check in front of a strict comparison (it's strict comparison)
* Modified a few comments and variable names
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.Utilities.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.Utilities.js
@@ -1,24 +1,22 @@
2 -// dependencies: mw
 2+( function() {
33
4 -( function( mw ) {
5 -
64 /**
75 * Check if a value is null, undefined, or the empty string.
86 *
9 - * @param {object} object Object to be checked
 7+ * @param {mixed} v Variable to be checked
108 * @return {boolean}
119 */
12 - mw.isEmpty = function( o ) {
13 - return ! mw.isDefined( o ) || o === null || ( typeof o === 'string' && o === '' );
 10+ mw.isEmpty = function( v ) {
 11+ return ! mw.isDefined( v ) || v === null || v === '';
1412 };
1513
1614 /**
1715 * Check if something is defined
18 - * @param {object}
 16+ * @param {mixed} v
1917 * @return {boolean}
2018 */
21 - mw.isDefined = function( o ) {
22 - return typeof o !== 'undefined';
 19+ mw.isDefined = function( v ) {
 20+ return typeof v !== 'undefined';
2321 };
2422
2523
@@ -32,4 +30,4 @@
3331 };
3432
3533
36 -} )( window.mediaWiki );
 34+} )();

Status & tagging log