Follow-up 9b582485: implement back compat for timeStamp correctly

timeStamp was used in two places, but we only had back-compat
code in one, so the other ended up using NaN.

Bonus: make jshint happy with the indentation of the $.extend() call.

Change-Id: I69000d11822658f2a227f9756093bc278f5fbaf5
This commit is contained in:
Roan Kattouw 2015-02-21 13:02:08 -08:00 committed by Ori.livneh
parent 14b098546a
commit 14a4a4ae1e

View file

@ -64,7 +64,8 @@
var action = topic.split( '.' )[1], var action = topic.split( '.' )[1],
event; event;
timing[action] = timeStamp || this.timeStamp; // I8e82acc12 back-compat timeStamp = timeStamp || this.timeStamp; // I8e82acc12 back-compat
timing[action] = timeStamp;
if ( action === 'init' ) { if ( action === 'init' ) {
// Regenerate editingSessionId // Regenerate editingSessionId
@ -72,20 +73,20 @@
} }
event = $.extend( { event = $.extend( {
version: 1, version: 1,
action: action, action: action,
editor: 'visualeditor', editor: 'visualeditor',
platform: 'desktop', // FIXME platform: 'desktop', // FIXME
integration: ve.init && ve.init.target && ve.init.target.constructor.static.integrationType || 'page', integration: ve.init && ve.init.target && ve.init.target.constructor.static.integrationType || 'page',
'page.id': mw.config.get( 'wgArticleId' ), 'page.id': mw.config.get( 'wgArticleId' ),
'page.title': mw.config.get( 'wgPageName' ), 'page.title': mw.config.get( 'wgPageName' ),
'page.ns': mw.config.get( 'wgNamespaceNumber' ), 'page.ns': mw.config.get( 'wgNamespaceNumber' ),
'page.revid': mw.config.get( 'wgRevisionId' ), 'page.revid': mw.config.get( 'wgRevisionId' ),
'page.length': -1, // FIXME 'page.length': -1, // FIXME
editingSessionId: editingSessionId, editingSessionId: editingSessionId,
'user.id': mw.user.getId(), 'user.id': mw.user.getId(),
'user.editCount': mw.config.get( 'wgUserEditCount', 0 ), 'user.editCount': mw.config.get( 'wgUserEditCount', 0 ),
'mediawiki.version': mw.config.get( 'wgVersion' ) 'mediawiki.version': mw.config.get( 'wgVersion' )
}, data ); }, data );
if ( mw.user.isAnon() ) { if ( mw.user.isAnon() ) {