From: Timo Tijhof Date: Mon, 3 Mar 2014 19:03:27 +0000 (+0100) Subject: jshint: Enable 'es3' option X-Git-Tag: 1.31.0-rc.0~16293^2 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=28cca609f5ebcdd17a0afbaf2b48da8945e4fc8a;p=lhc%2Fweb%2Fwiklou.git jshint: Enable 'es3' option Syntax new in ES5 not supported in older browsers using ES3. * Trailing comma's in object and array literals. * References to properties with protected names. Disabled for some test files. Change-Id: I24a0d1677f887097065fab874fea15f3855a4f34 --- diff --git a/.jshintrc b/.jshintrc index 9d6c4d2180..4eec7a0eb8 100644 --- a/.jshintrc +++ b/.jshintrc @@ -3,6 +3,7 @@ // Enforcing "eqeqeq": true, + "es3": true, "latedef": true, "noarg": true, "nonew": true, diff --git a/resources/src/mediawiki/mediawiki.debug.profile.js b/resources/src/mediawiki/mediawiki.debug.profile.js index f6bc81d5cd..9b0711a9fc 100644 --- a/resources/src/mediawiki/mediawiki.debug.profile.js +++ b/resources/src/mediawiki/mediawiki.debug.profile.js @@ -194,7 +194,7 @@ [ tail, 8 ], [ tail, 19 ], [ tail - 8, 8 ], - [ tail, 8 ], + [ tail, 8 ] ] ) ); g.appendChild( node ); @@ -277,7 +277,7 @@ trigger: 'manual', title: function () { return profile.buildFlyout( $( this ).data( 'period' ) ).html(); - }, + } } ).on( 'mouseenter', function () { hide(); addClass( this, 'tipsy-visible' ); @@ -305,7 +305,7 @@ */ xCoord: function ( msTimestamp ) { return ( msTimestamp - profile.data.timespan.start ) * profile.ratio; - }, + } }; function ProfileData( data, width, mergeThresholdPx, dropThresholdPx ) { @@ -382,7 +382,7 @@ return Object.keys( groups ).map( function ( group ) { return { name: group, - events: groups[group], + events: groups[group] }; } ); }; @@ -401,7 +401,7 @@ return [{ start: period.start, end: period.end, - contained: [period], + contained: [period] }]; } var last = result[result.length - 1]; @@ -417,7 +417,7 @@ result.push({ start: period.start, end: period.end, - contained: [period], + contained: [period] }); } return result; diff --git a/resources/src/mediawiki/mediawiki.jqueryMsg.js b/resources/src/mediawiki/mediawiki.jqueryMsg.js index 0a0b4f6671..8ea71d9481 100644 --- a/resources/src/mediawiki/mediawiki.jqueryMsg.js +++ b/resources/src/mediawiki/mediawiki.jqueryMsg.js @@ -1179,7 +1179,7 @@ * @param {Array} nodes List of nodes * @return {string} Other message */ - int: function ( nodes ) { + 'int': function ( nodes ) { return mw.jqueryMsg.getMessageFunction()( nodes[0].toLowerCase() ); }, diff --git a/skins/common/IEFixes.js b/skins/common/IEFixes.js index 03f133ef88..3174af134d 100644 --- a/skins/common/IEFixes.js +++ b/skins/common/IEFixes.js @@ -91,7 +91,7 @@ relativeforfloats = window.relativeforfloats = function () { setrelative = window.setrelative = function ( nodes ) { var i = 0; while ( i < nodes.length ) { - if ( ( ( nodes[i].style.float && nodes[i].style.float !== ( 'none' ) || + if ( ( ( nodes[i].style['float'] && nodes[i].style['float'] !== ( 'none' ) || ( nodes[i].align && nodes[i].align !== ( 'none' ) ) ) && ( !nodes[i].style.position || nodes[i].style.position !== 'relative' ) ) ) { diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js index f49be49ab5..f5fd16dbe2 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js @@ -1,3 +1,4 @@ +/*jshint -W024 */ ( function ( mw, $ ) { // mw.Title relies on these three config vars // Restore them after each test run diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js index b6a8a46c5e..7a58d38ddc 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js @@ -1,3 +1,4 @@ +/*jshint -W024 */ ( function ( mw, $ ) { QUnit.module( 'mediawiki.Uri', QUnit.newMwEnvironment( { setup: function () { diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.test.js index e1fcb6a9f5..f20ce67c76 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.test.js @@ -1,3 +1,4 @@ +/*jshint -W024 */ ( function ( mw, $ ) { var specialCharactersPageName; diff --git a/tests/qunit/suites/resources/startup.test.js b/tests/qunit/suites/resources/startup.test.js index 8fd789a52c..4e26bdcb1b 100644 --- a/tests/qunit/suites/resources/startup.test.js +++ b/tests/qunit/suites/resources/startup.test.js @@ -73,7 +73,7 @@ 'Mozilla/5.0 (Series40; NokiaX3-02/05.60; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.2.0.0.6', 'Mozilla/5.0 (Series40; Nokia305/05.92; Profile/MIDP-2.1 Configuration/CLDC-1.1) Gecko/20100401 S40OviBrowser/3.7.0.0.11', // Google Glass - 'Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; Glass 1 Build/IMM76L; XE11) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30', + 'Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; Glass 1 Build/IMM76L; XE11) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30' ], // No explicit support for or against these browsers, they're // given a shot at Grade A at their own risk.