Follows-up
8697ba835463c94. In order to allow for a simpler migration
and to keep compatibility over 1 stable release at least, deprecate
the module only, and keep the alias in the destination module.
This means 'mediawiki.RegExp' can be replaced with 'mediawiki.util',
without it causing code to break. It will still warn about
the method being deprecated, which can then be fixed separately,
depending on whether compat is needed.
This is mainly to reduce risk from mass migrations in user scripts
and gadgets (to do in two separate passes).
Bug: T218339
Change-Id: I07ba0a481b83fe704be3a17199070bafba4d5233
],
'mediawiki.RegExp' => [
'deprecated' => 'Please use mw.util.escapeRegExp() instead.',
- 'scripts' => 'resources/src/mediawiki.RegExp.js',
'targets' => [ 'desktop', 'mobile' ],
'dependencies' => [
'mediawiki.util',
+++ /dev/null
-( function () {
- mw.RegExp = {};
- // Backwards-compatible alias; @deprecated since 1.34
- mw.log.deprecate( mw.RegExp, 'escape', mw.util.escapeRegExp, 'Use mw.util.escapeRegExp() instead.', 'mw.RegExp.escape' );
-}() );
}
};
+// Backwards-compatible alias for mediawiki.RegExp module.
+// @deprecated since 1.34
+mw.RegExp = {};
+mw.log.deprecate( mw.RegExp, 'escape', util.escapeRegExp, 'Use mw.util.escapeRegExp() instead.', 'mw.RegExp.escape' );
+
// Not allowed outside unit tests
if ( window.QUnit ) {
util.setOptionsForTest = function ( opts ) {