Fix 'logName' parameter (5th) in many uses of mw.log.deprecate
authorBartosz Dziewoński <matma.rex@gmail.com>
Wed, 9 Aug 2017 22:10:34 +0000 (00:10 +0200)
committerJforrester <jforrester@wikimedia.org>
Thu, 10 Aug 2017 13:17:57 +0000 (13:17 +0000)
It's apparently supposed to contains the full name of the deprecated
property/function and apparently almost no one ever remembers it.

This fixes error messages like "Use of "wikiGetlink" is deprecated"
to instead read "Use of "mw.util.wikiGetlink" is deprecated", and
apparently improves some error logging detais.

Change-Id: I9b0d6761754e5844d51b71535e0547205eb20781

resources/src/jquery/jquery.mwExtension.js
resources/src/mediawiki.legacy/wikibits.js
resources/src/mediawiki.toolbar/toolbar.js
resources/src/mediawiki/mediawiki.util.js

index 4bcccdd..9d970ed 100644 (file)
                        return true;
                }
        }, function ( key, value ) {
-               mw.log.deprecate( $, key, value );
+               mw.log.deprecate( $, key, value, null, '$.' + key );
        } );
 
        mw.log.deprecate( $, 'escapeRE', function ( str ) {
                return str.replace( /([\\{}()|.?*+\-^$\[\]])/g, '\\$1' ); // eslint-disable-line no-useless-escape
-       }, 'Use mediawiki.RegExp instead.' );
+       }, 'Use mediawiki.RegExp instead.', '$.escapeRE' );
 
 }( jQuery, mediaWiki ) );
index 6eccc05..bd1b918 100644 (file)
@@ -99,7 +99,7 @@
        $.each( [ 'write', 'writeln' ], function ( idx, method ) {
                mw.log.deprecate( document, method, function () {
                        $( 'body' ).append( $.parseHTML( Array.prototype.join.call( arguments, '' ) ) );
-               }, 'Use jQuery or mw.loader.load instead.' );
+               }, 'Use jQuery or mw.loader.load instead.', 'document.' + method );
        } );
 
 }( mediaWiki, jQuery ) );
index 9ee499c..d55ed80 100644 (file)
 
        // Expose API publicly
        // @deprecated since MW 1.29
-       mw.log.deprecate( mw, 'toolbar', toolbar );
+       mw.log.deprecate( mw, 'toolbar', toolbar, null, 'mw.toolbar' );
 
        $( function () {
                var i, button;
index 0e423be..34f7eba 100644 (file)
         * @inheritdoc #getUrl
         * @deprecated since 1.23 Use #getUrl instead.
         */
-       mw.log.deprecate( util, 'wikiGetlink', util.getUrl, 'Use mw.util.getUrl instead.' );
+       mw.log.deprecate( util, 'wikiGetlink', util.getUrl, 'Use mw.util.getUrl instead.', 'mw.util.wikiGetlink' );
 
        /**
         * Add the appropriate prefix to the accesskey shown in the tooltip.
                }
 
                $nodes.updateTooltipAccessKeys();
-       }, 'Use jquery.accessKeyLabel instead.' );
+       }, 'Use jquery.accessKeyLabel instead.', 'mw.util.updateTooltipAccessKeys' );
 
        /**
         * Add a little box at the top of the screen to inform the user of
                }
                mw.notify( message, { autoHide: true, tag: 'legacy' } );
                return true;
-       }, 'Use mw.notify instead.' );
+       }, 'Use mw.notify instead.', 'mw.util.jsMessage' );
 
        /**
         * Encode the string like Sanitizer::escapeId() in PHP
         */
        mw.log.deprecate( util, 'escapeId', function ( str ) {
                return escapeIdInternal( str, 'legacy' );
-       }, 'Use mw.util.escapeIdForAttribute or mw.util.escapeIdForLink instead.' );
+       }, 'Use mw.util.escapeIdForAttribute or mw.util.escapeIdForLink instead.', 'mw.util.escapeId' );
 
        /**
         * Initialisation of mw.util.$content