From: James D. Forrester Date: Thu, 3 Sep 2015 20:59:44 +0000 (-0700) Subject: build: Enable altered jscs rule 'disallowQuotedKeysInObjects' and make pass X-Git-Tag: 1.31.0-rc.0~10120^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22suivi_revisions%22%2C%22id_auteur=%24connecte%22%29%20.%20%22?a=commitdiff_plain;h=8bf774f1eba7e0820dc14d7e4f739dac9170b7f8;p=lhc%2Fweb%2Fwiklou.git build: Enable altered jscs rule 'disallowQuotedKeysInObjects' and make pass Change-Id: I172327cdf27adb77615cb6a2ea4c76020062a45a --- diff --git a/.jscsrc b/.jscsrc index 70a404b621..87cae78a2d 100644 --- a/.jscsrc +++ b/.jscsrc @@ -1,10 +1,11 @@ { "preset": "wikimedia", + "es3": true, - "disallowQuotedKeysInObjects": null, "requireVarDeclFirst": null, "jsDoc": null, + "disallowQuotedKeysInObjects": "allButReserved", "requireDotNotation": { "allExcept": [ "keywords" ] }, "excludeFiles": [ diff --git a/resources/src/jquery/jquery.expandableField.js b/resources/src/jquery/jquery.expandableField.js index 10d814ccff..b9bb77a8df 100644 --- a/resources/src/jquery/jquery.expandableField.js +++ b/resources/src/jquery/jquery.expandableField.js @@ -23,7 +23,7 @@ expandField: function ( e, context ) { context.config.beforeExpand.call( context.data.$field, context ); context.data.$field - .animate( { 'width': context.data.expandedWidth }, 'fast', function () { + .animate( { width: context.data.expandedWidth }, 'fast', function () { context.config.afterExpand.call( this, context ); } ); }, @@ -33,7 +33,7 @@ condenseField: function ( e, context ) { context.config.beforeCondense.call( context.data.$field, context ); context.data.$field - .animate( { 'width': context.data.condensedWidth }, 'fast', function () { + .animate( { width: context.data.condensedWidth }, 'fast', function () { context.config.afterCondense.call( this, context ); } ); }, diff --git a/resources/src/jquery/jquery.farbtastic.js b/resources/src/jquery/jquery.farbtastic.js index d7024cc8f0..f70913f90f 100644 --- a/resources/src/jquery/jquery.farbtastic.js +++ b/resources/src/jquery/jquery.farbtastic.js @@ -52,10 +52,10 @@ jQuery._farbtastic = function (container, callback) { if (this.currentStyle.backgroundImage != 'none') { var image = this.currentStyle.backgroundImage; image = this.currentStyle.backgroundImage.slice(5, image.length - 2); - $(this).css({ - 'backgroundImage': 'none', - 'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')" - }); + $(this).css( { + backgroundImage: 'none', + filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')" + } ); } }); } diff --git a/resources/src/jquery/jquery.placeholder.js b/resources/src/jquery/jquery.placeholder.js index e385089610..9c18a919c1 100644 --- a/resources/src/jquery/jquery.placeholder.js +++ b/resources/src/jquery/jquery.placeholder.js @@ -74,9 +74,9 @@ if ( input.type === 'password' ) { if ( !$input.data( 'placeholder-textinput' ) ) { try { - $replacement = $input.clone().attr( { 'type': 'text' } ); + $replacement = $input.clone().attr( { type: 'text' } ); } catch ( e ) { - $replacement = $( '' ).attr( $.extend( args( this ), { 'type': 'text' } ) ); + $replacement = $( '' ).attr( $.extend( args( this ), { type: 'text' } ) ); } $replacement .removeAttr( 'name' ) @@ -157,7 +157,7 @@ placeholder.textarea = isTextareaSupported; hooks = { - 'get': function ( element ) { + get: function ( element ) { var $element = $( element ), $passwordInput = $element.data( 'placeholder-password' ); if ( $passwordInput ) { @@ -166,7 +166,7 @@ return $element.data( 'placeholder-enabled' ) && $element.hasClass( 'placeholder' ) ? '' : element.value; }, - 'set': function ( element, value ) { + set: function ( element, value ) { var $element = $( element ), $passwordInput = $element.data( 'placeholder-password' ); if ( $passwordInput ) { diff --git a/resources/src/jquery/jquery.spinner.js b/resources/src/jquery/jquery.spinner.js index 361d3e0804..41c555b71c 100644 --- a/resources/src/jquery/jquery.spinner.js +++ b/resources/src/jquery/jquery.spinner.js @@ -67,7 +67,7 @@ opts = $.extend( {}, defaults, opts ); - var $spinner = $( '
', { 'class': 'mw-spinner', 'title': '...' } ); + var $spinner = $( '
', { 'class': 'mw-spinner', title: '...' } ); if ( opts.id !== undefined ) { $spinner.attr( 'id', 'mw-spinner-' + opts.id ); } diff --git a/resources/src/jquery/jquery.textSelection.js b/resources/src/jquery/jquery.textSelection.js index 367c78e914..2573813dcf 100644 --- a/resources/src/jquery/jquery.textSelection.js +++ b/resources/src/jquery/jquery.textSelection.js @@ -160,7 +160,7 @@ context.fn.restoreCursorAndScrollTop(); } if ( options.selectionStart !== undefined ) { - $( this ).textSelection( 'setSelection', { 'start': options.selectionStart, 'end': options.selectionEnd } ); + $( this ).textSelection( 'setSelection', { start: options.selectionStart, end: options.selectionEnd } ); } selText = $( this ).textSelection( 'getSelection' ); @@ -203,7 +203,7 @@ $( this ).focus(); if ( options.selectionStart !== undefined ) { - $( this ).textSelection( 'setSelection', { 'start': options.selectionStart, 'end': options.selectionEnd } ); + $( this ).textSelection( 'setSelection', { start: options.selectionStart, end: options.selectionEnd } ); } selText = $( this ).textSelection( 'getSelection' ); diff --git a/resources/src/mediawiki.action/mediawiki.action.edit.preview.js b/resources/src/mediawiki.action/mediawiki.action.edit.preview.js index ce627f56fa..0610643bcf 100644 --- a/resources/src/mediawiki.action/mediawiki.action.edit.preview.js +++ b/resources/src/mediawiki.action/mediawiki.action.edit.preview.js @@ -159,7 +159,7 @@ li = $( '
  • ' ) .append( $( '' ) .attr( { - 'href': mw.util.getUrl( template[ '*' ] ), + href: mw.util.getUrl( template[ '*' ] ), 'class': ( template.exists !== undefined ? '' : 'new' ) } ) .text( template[ '*' ] ) @@ -179,10 +179,10 @@ .addClass( 'interlanguage-link interwiki-' + langlink.lang ) .append( $( '' ) .attr( { - 'href': langlink.url, - 'title': langlink[ '*' ] + ' - ' + langlink.langname, - 'lang': langlink.lang, - 'hreflang': langlink.lang + href: langlink.url, + title: langlink[ '*' ] + ' - ' + langlink.langname, + lang: langlink.lang, + hreflang: langlink.lang } ) .text( langlink.autonym ) ); @@ -268,9 +268,9 @@ $( '.portal:last' ).after( $( '
    ' ).attr( { 'class': 'portal', - 'id': 'p-lang', - 'role': 'navigation', - 'title': mw.msg( 'tooltip-p-lang' ), + id: 'p-lang', + role: 'navigation', + title: mw.msg( 'tooltip-p-lang' ), 'aria-labelledby': 'p-lang-label' } ) .append( $( '

    ' ).attr( 'id', 'p-lang-label' ).text( mw.msg( 'otherlanguages' ) ) ) diff --git a/resources/src/mediawiki.action/mediawiki.action.view.postEdit.js b/resources/src/mediawiki.action/mediawiki.action.view.postEdit.js index 31250c9e2d..168a1c18d5 100644 --- a/resources/src/mediawiki.action/mediawiki.action.view.postEdit.js +++ b/resources/src/mediawiki.action/mediawiki.action.view.postEdit.js @@ -68,7 +68,7 @@ // postedit-confirmation-saved // postedit-confirmation-created // postedit-confirmation-restored - 'message': mw.msg( + message: mw.msg( 'postedit-confirmation-' + cookieVal, mw.user ) diff --git a/resources/src/mediawiki/mediawiki.jqueryMsg.js b/resources/src/mediawiki/mediawiki.jqueryMsg.js index bd9ad026d8..0502304319 100644 --- a/resources/src/mediawiki/mediawiki.jqueryMsg.js +++ b/resources/src/mediawiki/mediawiki.jqueryMsg.js @@ -15,7 +15,7 @@ slice = Array.prototype.slice, parserDefaults = { magic: { - 'SITENAME': mw.config.get( 'wgSiteName' ) + SITENAME: mw.config.get( 'wgSiteName' ) }, // Whitelist for allowed HTML elements in wikitext. // Self-closing tags are not currently supported. @@ -1279,9 +1279,9 @@ } messageFunction = mw.jqueryMsg.getMessageFunction( { - 'messages': this.map, + messages: this.map, // For format 'escaped', escaping part is handled by mediawiki.js - 'format': this.format + format: this.format } ); return messageFunction( this.key, this.parameters ); }; diff --git a/tests/qunit/suites/resources/jquery/jquery.accessKeyLabel.test.js b/tests/qunit/suites/resources/jquery/jquery.accessKeyLabel.test.js index bd622d90e7..cf34fc1103 100644 --- a/tests/qunit/suites/resources/jquery/jquery.accessKeyLabel.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.accessKeyLabel.test.js @@ -1,7 +1,7 @@ ( function ( $ ) { QUnit.module( 'jquery.accessKeyLabel', QUnit.newMwEnvironment( { messages: { - 'brackets': '[$1]', + brackets: '[$1]', 'word-separator': ' ' } } ) ); diff --git a/tests/qunit/suites/resources/jquery/jquery.localize.test.js b/tests/qunit/suites/resources/jquery/jquery.localize.test.js index 786b9f6841..c503fc9932 100644 --- a/tests/qunit/suites/resources/jquery/jquery.localize.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.localize.test.js @@ -76,8 +76,8 @@ html = '
    '; $lc = $( html ).localize( { keys: { - 'title': 'foo-' + x + '-title', - 'label': 'foo-' + x + '-label' + title: 'foo-' + x + '-title', + label: 'foo-' + x + '-label' } } ).find( 'span' ); @@ -100,12 +100,12 @@ $lc = $( html ).localize( { prefix: 'foo-', keys: { - 'title': x + '-title', - 'label': x + '-label' + title: x + '-title', + label: x + '-label' }, params: { - 'title': [ sitename, '3 minutes ago' ], - 'label': [ sitename, '3 minutes ago' ] + title: [ sitename, '3 minutes ago' ], + label: [ sitename, '3 minutes ago' ] } } ).find( 'span' ); diff --git a/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js b/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js index c0da824bbf..032551d815 100644 --- a/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.tablesorter.parsers.test.js @@ -12,19 +12,19 @@ setup: function () { this.liveMonths = mw.language.months; mw.language.months = { - 'keys': { - 'names': [ 'january', 'february', 'march', 'april', 'may_long', 'june', + keys: { + names: [ 'january', 'february', 'march', 'april', 'may_long', 'june', 'july', 'august', 'september', 'october', 'november', 'december' ], - 'genitive': [ 'january-gen', 'february-gen', 'march-gen', 'april-gen', 'may-gen', 'june-gen', + genitive: [ 'january-gen', 'february-gen', 'march-gen', 'april-gen', 'may-gen', 'june-gen', 'july-gen', 'august-gen', 'september-gen', 'october-gen', 'november-gen', 'december-gen' ], - 'abbrev': [ 'jan', 'feb', 'mar', 'apr', 'may', 'jun', + abbrev: [ 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec' ] }, - 'names': [ 'January', 'February', 'March', 'April', 'May', 'June', + names: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], - 'genitive': [ 'January', 'February', 'March', 'April', 'May', 'June', + genitive: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], - 'abbrev': [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + abbrev: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ] }; }, @@ -116,8 +116,8 @@ ]; parserTest( 'MDY Dates using dmy content language', 'date', simpleMDYDatesInDMY, function () { mw.config.set( { - 'wgDefaultDateFormat': 'dmy', - 'wgPageContentLanguage': 'de' + wgDefaultDateFormat: 'dmy', + wgPageContentLanguage: 'de' } ); } ); diff --git a/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js b/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js index e9ae8c0c68..be04b97984 100644 --- a/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js +++ b/tests/qunit/suites/resources/jquery/jquery.tablesorter.test.js @@ -159,19 +159,19 @@ setup: function () { this.liveMonths = mw.language.months; mw.language.months = { - 'keys': { - 'names': [ 'january', 'february', 'march', 'april', 'may_long', 'june', + keys: { + names: [ 'january', 'february', 'march', 'april', 'may_long', 'june', 'july', 'august', 'september', 'october', 'november', 'december' ], - 'genitive': [ 'january-gen', 'february-gen', 'march-gen', 'april-gen', 'may-gen', 'june-gen', + genitive: [ 'january-gen', 'february-gen', 'march-gen', 'april-gen', 'may-gen', 'june-gen', 'july-gen', 'august-gen', 'september-gen', 'october-gen', 'november-gen', 'december-gen' ], - 'abbrev': [ 'jan', 'feb', 'mar', 'apr', 'may', 'jun', + abbrev: [ 'jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec' ] }, - 'names': [ 'January', 'February', 'March', 'April', 'May', 'June', + names: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], - 'genitive': [ 'January', 'February', 'March', 'April', 'May', 'June', + genitive: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], - 'abbrev': [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + abbrev: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ] }; }, @@ -654,10 +654,10 @@ umlautWordsSorted, function ( $table ) { mw.config.set( 'tableSorterCollation', { - 'ä': 'ae', - 'ö': 'oe', - 'ß': 'ss', - 'ü': 'ue' + ä: 'ae', + ö: 'oe', + ß: 'ss', + ü: 'ue' } ); $table.tablesorter(); diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js index 225b5f10de..d5425a1064 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.Title.test.js @@ -100,33 +100,35 @@ // testing custom / localized namespace 100: 'Penguins' }, + // jscs: disable requireCamelCaseOrUpperCaseIdentifiers wgNamespaceIds: { - 'media': -2, - 'special': -1, + media: -2, + special: -1, '': 0, - 'talk': 1, - 'user': 2, - 'user_talk': 3, - 'wikipedia': 4, - 'wikipedia_talk': 5, - 'file': 6, - 'file_talk': 7, - 'mediawiki': 8, - 'mediawiki_talk': 9, - 'template': 10, - 'template_talk': 11, - 'help': 12, - 'help_talk': 13, - 'category': 14, - 'category_talk': 15, - 'image': 6, - 'image_talk': 7, - 'project': 4, - 'project_talk': 5, + talk: 1, + user: 2, + user_talk: 3, + wikipedia: 4, + wikipedia_talk: 5, + file: 6, + file_talk: 7, + mediawiki: 8, + mediawiki_talk: 9, + template: 10, + template_talk: 11, + help: 12, + help_talk: 13, + category: 14, + category_talk: 15, + image: 6, + image_talk: 7, + project: 4, + project_talk: 5, // Testing custom namespaces and aliases - 'penguins': 100, - 'antarctic_waterfowl': 100 + penguins: 100, + antarctic_waterfowl: 100 }, + // jscs: enable requireCamelCaseOrUpperCaseIdentifiers wgCaseSensitiveNamespaces: [] } } ) ); diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js index aa66907903..51374bd8f4 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.Uri.test.js @@ -270,7 +270,7 @@ assert.deepEqual( original.query, - { 'one': '1', 'two': '2' }, + { one: '1', two: '2' }, 'Properties is deep cloned (bug 37708)' ); } ); @@ -367,7 +367,7 @@ host: 'example.com', port: undefined, path: '/wiki/Foo', - query: { 'v': '2' }, + query: { v: '2' }, fragment: undefined }, 'basic object properties' diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js index a10502249e..1fc1b0e563 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.jqueryMsg.test.js @@ -513,7 +513,7 @@ 'curly-brace': '{{int:message}}', 'single-square-bracket': '[https://www.mediawiki.org/ MediaWiki]', 'double-square-bracket': '[[Some page]]', - 'regular': 'Other message' + regular: 'Other message' } ); oldGMF = mw.jqueryMsg.getMessageFunction; diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js index 6615bfa78a..399290ca46 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js @@ -11,7 +11,7 @@ }, messages: { // mw.language.listToText test - 'and': ' and', + and: ' and', 'comma-separator': ', ', 'word-separator': ' ' } diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.test.js index fd3f99073a..f7ca45b552 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.test.js @@ -108,21 +108,21 @@ // Multiple values at once someValues = { - 'foo': 'bar', - 'lorem': 'ipsum', - 'MediaWiki': true + foo: 'bar', + lorem: 'ipsum', + MediaWiki: true }; assert.strictEqual( conf.set( someValues ), true, 'Map.set returns boolean true if multiple values were set by passing an object' ); assert.deepEqual( conf.get( [ 'foo', 'lorem' ] ), { - 'foo': 'bar', - 'lorem': 'ipsum' + foo: 'bar', + lorem: 'ipsum' }, 'Map.get returns multiple values correctly as an object' ); assert.deepEqual( conf, new mw.Map( conf.values ), 'new mw.Map maps over existing values-bearing object' ); assert.deepEqual( conf.get( [ 'foo', 'notExist' ] ), { - 'foo': 'bar', - 'notExist': null + foo: 'bar', + notExist: null }, 'Map.get return includes keys that were not found as null values' ); // Interacting with globals and accessing the values object @@ -491,7 +491,7 @@ QUnit.start(); }, { - 'all': '.mw-test-implement-a { float: right; }' + all: '.mw-test-implement-a { float: right; }' } ); @@ -546,9 +546,9 @@ } ); }, { - 'url': { - 'print': [ urlStyleTest( '.mw-test-implement-b1', 'text-align', 'center' ) ], - 'screen': [ + url: { + print: [ urlStyleTest( '.mw-test-implement-b1', 'text-align', 'center' ) ], + screen: [ // bug 40834: Make sure it actually works with more than 1 stylesheet reference urlStyleTest( '.mw-test-implement-b2', 'float', 'left' ), urlStyleTest( '.mw-test-implement-b3', 'float', 'right' ) @@ -583,7 +583,7 @@ QUnit.start(); }, { - 'all': '.mw-test-implement-c { float: right; }' + all: '.mw-test-implement-c { float: right; }' } ); @@ -619,8 +619,8 @@ } ); }, { - 'all': [ urlStyleTest( '.mw-test-implement-d', 'float', 'right' ) ], - 'print': [ urlStyleTest( '.mw-test-implement-d2', 'text-align', 'center' ) ] + all: [ urlStyleTest( '.mw-test-implement-d', 'float', 'right' ) ], + print: [ urlStyleTest( '.mw-test-implement-d2', 'text-align', 'center' ) ] } ); @@ -654,7 +654,7 @@ } ); }, { - 'css': [ + css: [ '@import url(\'' + urlStyleTest( '.mw-test-implement-import', 'float', 'right' ) + '\');\n' @@ -703,7 +703,7 @@ QUnit.start(); }, { - 'all': '.mw-test-implement-e { float: right; }' + all: '.mw-test-implement-e { float: right; }' } ); @@ -717,7 +717,7 @@ ); }, { - 'all': '.mw-test-implement-e2 { float: left; }' + all: '.mw-test-implement-e2 { float: left; }' } ); @@ -734,7 +734,9 @@ QUnit.asyncTest( 'mw.loader.implement( only messages )', 2, function ( assert ) { assert.assertFalse( mw.messages.exists( 'bug_29107' ), 'Verify that the test message doesn\'t exist yet' ); - mw.loader.implement( 'test.implement.msgs', [], {}, { 'bug_29107': 'loaded' } ); + // jscs: disable requireCamelCaseOrUpperCaseIdentifiers + mw.loader.implement( 'test.implement.msgs', [], {}, { bug_29107: 'loaded' } ); + // jscs: enable requireCamelCaseOrUpperCaseIdentifiers mw.loader.using( 'test.implement.msgs', function () { QUnit.start(); assert.ok( mw.messages.exists( 'bug_29107' ), 'Bug 29107: messages-only module should implement ok' ); diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js index 450f0f5d64..c1f1484c3f 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js @@ -83,7 +83,7 @@ }, messages: { // Used by accessKeyLabel in test for addPortletLink - 'brackets': '[$1]', + brackets: '[$1]', 'word-separator': ' ' } } ) ); @@ -134,10 +134,10 @@ QUnit.test( 'wikiScript', 4, function ( assert ) { mw.config.set( { - 'wgScript': '/w/i.php', // customized wgScript for bug 39103 - 'wgLoadScript': '/w/l.php', // customized wgLoadScript for bug 39103 - 'wgScriptPath': '/w', - 'wgScriptExtension': '.php' + wgScript: '/w/i.php', // customized wgScript for bug 39103 + wgLoadScript: '/w/l.php', // customized wgLoadScript for bug 39103 + wgScriptPath: '/w', + wgScriptExtension: '.php' } ); assert.equal( mw.util.wikiScript(), mw.config.get( 'wgScript' ), @@ -176,10 +176,10 @@ url = 'http://example.org/#&foo=bad'; assert.strictEqual( mw.util.getParamValue( 'foo', url ), null, 'Ignore hash if param is not in querystring but in hash (bug 27427)' ); - url = 'example.org?' + $.param( { 'TEST': 'a b+c' } ); + url = 'example.org?' + $.param( { TEST: 'a b+c' } ); assert.strictEqual( mw.util.getParamValue( 'TEST', url ), 'a b+c', 'Bug 30441: getParamValue must understand "+" encoding of space' ); - url = 'example.org?' + $.param( { 'TEST': 'a b+c d' } ); // check for sloppy code from r95332 :) + url = 'example.org?' + $.param( { TEST: 'a b+c d' } ); // check for sloppy code from r95332 :) assert.strictEqual( mw.util.getParamValue( 'TEST', url ), 'a b+c d', 'Bug 30441: getParamValue must understand "+" encoding of space (multiple spaces)' ); } );