return mw.format.apply( null, [ this.map.get( this.key ) ].concat( this.parameters ) );
},
+ // eslint-disable-next-line valid-jsdoc
/**
* Add (does not replace) parameters for `$N` placeholder values.
*
}
};
+ /* eslint-disable no-console */
log = ( function () {
// Also update the restoration of methods in mediawiki.log.js
// when adding or removing methods here.
return log;
}() );
+ /* eslint-enable no-console */
/**
* @class mw
* Utility function for execute()
*
* @ignore
+ * @param {string} [media] Media attribute
+ * @param {string} url URL
*/
function addLink( media, url ) {
var el = document.createElement( 'link' );
* to a query string of the form foo.bar,baz|bar.baz,quux
*
* @private
+ * @param {Object} moduleMap Module map
+ * @return {string} Module query string
*/
function buildModulesString( moduleMap ) {
var p, prefix,
*
* @protected
* @since 1.27
+ * @param {string} moduleName Module name
+ * @return {Mixed} Exported value
*/
require: function ( moduleName ) {
var state = mw.loader.getState( moduleName );
*
* @param {string} module Module name
* @param {Object} descriptor The module's descriptor as set in the registry
+ * @return {boolean} Module was set
*/
set: function ( module, descriptor ) {
var args, key, src;
}
} catch ( e ) {
mw.track( 'resourceloader.exception', { exception: e, source: 'store-localstorage-json' } );
- return;
+ return false;
}
src = 'mw.loader.implement(' + args.join( ',' ) + ');';
}
mw.loader.store.items[ key ] = src;
mw.loader.store.update();
+ return true;
},
/**
* Iterate through the module store, removing any item that does not correspond
* (in name and version) to an item in the module registry.
+ *
+ * @return {boolean} Store was pruned
*/
prune: function () {
var key, module;
delete mw.loader.store.items[ key ];
}
}
+ return true;
},
/**
* Wrapper object for raw HTML passed to mw.html.element().
*
* @class mw.html.Raw
+ * @constructor
+ * @param {string} value
*/
Raw: function ( value ) {
this.value = value;
* Wrapper object for CDATA element contents passed to mw.html.element()
*
* @class mw.html.Cdata
+ * @constructor
+ * @param {string} value
*/
Cdata: function ( value ) {
this.value = value;
*/
remove: list.remove,
+ // eslint-disable-next-line valid-jsdoc
/**
* Run a hook.
*
* @param {string} [data.module] Name of module which caused the error
*/
function logError( topic, data ) {
+ /* eslint-disable no-console */
var msg,
e = data.exception,
source = data.source,
console.error( String( e ), e );
}
}
+ /* eslint-enable no-console */
}
// Subscribe to error streams