From 840266c5c743ba425ccc3e3ed451e7e419560e45 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 1 May 2014 01:39:33 +0200 Subject: [PATCH] mediawiki.util.test: Suppress deprecation notice for jsMessage * Hide the false positive when running the QUnit test suite. * Clean up documentation comment (tag order) for consistency with the rest of the code base. Follows-up Ib41d5245682552, I211593629ca2. Change-Id: Iac42aef26f78b5637e5aaafb6fc48e60e9ea0e3f --- resources/src/mediawiki/mediawiki.util.js | 10 +++++----- .../suites/resources/mediawiki/mediawiki.util.test.js | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/resources/src/mediawiki/mediawiki.util.js b/resources/src/mediawiki/mediawiki.util.js index f09d03c3a5..5fc737185e 100644 --- a/resources/src/mediawiki/mediawiki.util.js +++ b/resources/src/mediawiki/mediawiki.util.js @@ -465,14 +465,13 @@ mw.log.deprecate( util, 'wikiGetlink', util.getUrl, 'Use mw.util.getUrl instead.' ); /** - * @property {string} tooltipAccessKeyPrefix * Access key prefix. Might be wrong for browsers implementing the accessKeyLabel property. + * @property {string} tooltipAccessKeyPrefix * @deprecated since 1.24 Use the module jquery.accessKeyLabel instead. */ mw.log.deprecate( util, 'tooltipAccessKeyPrefix', $.fn.updateTooltipAccessKeys.getAccessKeyPrefix(), 'Use jquery.accessKeyLabel instead.' ); /** - * @property {RegExp} tooltipAccessKeyRegexp * Regex to match accesskey tooltips. * * Should match: @@ -486,19 +485,20 @@ * * Will probably not work for browsers implementing the accessKeyLabel property. * + * @property {RegExp} tooltipAccessKeyRegexp * @deprecated since 1.24 Use the module jquery.accessKeyLabel instead. */ mw.log.deprecate( util, 'tooltipAccessKeyRegexp', /\[(ctrl-)?(option-)?(alt-)?(shift-)?(esc-)?(.)\]$/, 'Use jquery.accessKeyLabel instead.' ); /** - * @method jsMessage * Add a little box at the top of the screen to inform the user of * something, replacing any previous message. * Calling with no arguments, with an empty string or null will hide the message * - * @param {Mixed} message The DOM-element, jQuery object or HTML-string to be put inside the message box. - * to allow CSS/JS to hide different boxes. null = no class used. + * @method jsMessage * @deprecated since 1.20 Use mw#notify + * @param {Mixed} message The DOM-element, jQuery object or HTML-string to be put inside the message box. + * to allow CSS/JS to hide different boxes. null = no class used. */ mw.log.deprecate( util, 'jsMessage', function ( message ) { if ( !arguments.length || message === '' || message === null ) { diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js index 1e059e1f1c..81fda7e3b2 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js @@ -210,7 +210,9 @@ } ); QUnit.test( 'jsMessage', 1, function ( assert ) { + this.suppressWarnings(); var a = mw.util.jsMessage( 'MediaWiki is Awesome.' ); + this.restoreWarnings(); assert.ok( a, 'Basic checking of return value' ); // Clean up -- 2.20.1