Merge "mw.util: Add a deprecation message to escapeId()"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 12 Aug 2017 17:19:46 +0000 (17:19 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 12 Aug 2017 17:19:46 +0000 (17:19 +0000)
resources/src/mediawiki/mediawiki.util.js

index d0ec585..0e423be 100644 (file)
                 */
                rawurlencode: rawurlencode,
 
-               /**
-                * Encode the string like Sanitizer::escapeId() in PHP
-                * @deprecated since 1.30 use escapeIdForAttribute() or escapeIdForLink()
-                *
-                * @param {string} str String to be encoded.
-                * @return {string} Encoded string
-                */
-               escapeId: function ( str ) {
-                       return escapeIdInternal( str, 'legacy' );
-               },
-
                /**
                 * Encode string into HTML id compatible form suitable for use in HTML
                 * Analog to PHP Sanitizer::escapeIdForAttribute()
                return true;
        }, 'Use mw.notify instead.' );
 
+       /**
+        * Encode the string like Sanitizer::escapeId() in PHP
+        *
+        * @method escapeId
+        * @deprecated since 1.30 use escapeIdForAttribute() or escapeIdForLink()
+        * @param {string} str String to be encoded.
+        * @return {string} Encoded string
+        */
+       mw.log.deprecate( util, 'escapeId', function ( str ) {
+               return escapeIdInternal( str, 'legacy' );
+       }, 'Use mw.util.escapeIdForAttribute or mw.util.escapeIdForLink instead.' );
+
        /**
         * Initialisation of mw.util.$content
         */