ext.uls.eventlogger: Remove unused code
Follows-upe58be7c411,1ad0c9c819. * The mw.uls.eventlogger property does not appear to be used anywhere indexed by Codesearch. It was also undocumented. Removed without deprecation. Kept exposed for debugging purpopses via module.exports, which could be retreived in tests via require(), or via mw.loader.require() from the browser console. * Remove redundant $.Deferred wrapper. Change-Id: Id081038e5d4902c7e38967353c6f551c12517311
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
* ULS Event logger
|
||||
* See https://meta.wikimedia.org/wiki/Schema:UniversalLanguageSelector
|
||||
*
|
||||
* @private
|
||||
* @since 2013.08
|
||||
*/
|
||||
function ULSEventLogger() {
|
||||
@@ -43,26 +44,16 @@
|
||||
*
|
||||
* @param {Object} event Event action and optional fields
|
||||
* @param {string} schema The schema; 'UniversalLanguageSelector' is the default
|
||||
* @return {jQuery.Promise} jQuery Promise object for the logging call
|
||||
* @return {jQuery.Promise} Promise object for the logging call
|
||||
*/
|
||||
log: function ( event, schema ) {
|
||||
// FIXME: We need to create our own deferred for two reasons:
|
||||
// - logEvent might not be executed immediately
|
||||
// - we cannot reject a promise returned by it
|
||||
// So we proxy the original promises status updates.
|
||||
var deferred = $.Deferred();
|
||||
|
||||
schema = schema || this.schemaDefault;
|
||||
|
||||
if ( schema === this.schemaDefault ) {
|
||||
event = $.extend( {}, this.eventBase, event );
|
||||
}
|
||||
|
||||
mw.eventLog.logEvent( schema, event )
|
||||
.done( deferred.resolve )
|
||||
.fail( deferred.reject );
|
||||
|
||||
return deferred.promise();
|
||||
return mw.eventLog.logEvent( schema, event );
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -244,6 +235,8 @@
|
||||
}
|
||||
};
|
||||
|
||||
mw.uls = mw.uls || {};
|
||||
mw.uls.eventlogger = new ULSEventLogger();
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
module.exports = new ULSEventLogger();
|
||||
}() );
|
||||
|
||||
Reference in New Issue
Block a user