Fix all jshint errors

Change-Id: Ib8fb350132bb34c1e063eb644af5aeff833f95e8
This commit is contained in:
Santhosh Thottingal
2013-05-20 14:51:36 +05:30
parent 00c37b9218
commit bf270812f5
5 changed files with 17 additions and 8 deletions

View File

@@ -35,6 +35,15 @@
"predef": [ "predef": [
"mediaWiki", "mediaWiki",
"jQuery", "jQuery",
"QUnit"
/* Qunit specific rules */
"QUnit",
"module",
"expect",
"start",
"stop",
"ok",
"test",
"strictEqual"
] ]
} }

View File

@@ -66,6 +66,7 @@
return ( window.navigator.language || window.navigator.userLanguage ).split( '-' )[0]; return ( window.navigator.language || window.navigator.userLanguage ).split( '-' )[0];
}; };
/*jshint camelcase:false*/
mw.uls.getCountryCode = function () { mw.uls.getCountryCode = function () {
return window.Geo && ( window.Geo.country || window.Geo.country_code ); return window.Geo && ( window.Geo.country || window.Geo.country_code );
}; };

View File

@@ -477,9 +477,8 @@
if ( success ) { if ( success ) {
// Live ime update // Live ime update
this.$parent.hide(); this.$parent.hide();
} else {
// FIXME failure. what to do?!
} }
// FIXME in case of failure. what to do?!
}, },
/** /**

View File

@@ -167,8 +167,9 @@
* @param callback * @param callback
*/ */
save: function ( callback ) { save: function ( callback ) {
var ulsPreferences = this; var ulsPreferences = this,
successFunction,
failFunction;
callback = callback || $.noop; callback = callback || $.noop;
if ( this.isAnon ) { if ( this.isAnon ) {
@@ -176,7 +177,6 @@
$.jStorage.set( this.preferenceName, this.preferences ); $.jStorage.set( this.preferenceName, this.preferences );
callback.call( this, true ); callback.call( this, true );
} else { } else {
var successFunction, failFunction;
successFunction = function () { successFunction = function () {
callback.call( this, true ); callback.call( this, true );

View File

@@ -17,7 +17,7 @@
* @licence MIT License * @licence MIT License
*/ */
( function ( $ ) { ( function ( $, mw ) {
'use strict'; 'use strict';
module( 'ext.uls', QUnit.newMwEnvironment() ); module( 'ext.uls', QUnit.newMwEnvironment() );
@@ -68,4 +68,4 @@
prefs.set( prefName, undefined ); prefs.set( prefName, undefined );
prefs.save(); prefs.save();
} ); } );
}( jQuery ) ); }( jQuery, mediaWiki ) );