mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-24 00:03:56 +00:00
Make JSHint enforce ES3 compatibility
Also fix ES3 compatibility errors. Upstreamed issue with sinon.stub().throws(): https://github.com/cjohansen/Sinon.JS/issues/488 Change-Id: I93b0d575484089b293d94ea860d245def4646cb4
This commit is contained in:
parent
91e0a176ba
commit
f9d06141f4
|
@ -22,6 +22,7 @@
|
|||
|
||||
// Enforcing
|
||||
"bitwise": true,
|
||||
"es3": true,
|
||||
// Relaxing
|
||||
"laxbreak": true,
|
||||
"smarttabs": true,
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
* @returns {number} Sampling factor
|
||||
*/
|
||||
L.getActionFactor = function ( action ) {
|
||||
return this.samplingFactorMap[ action ] || this.samplingFactorMap.default;
|
||||
return this.samplingFactorMap[ action ] || this.samplingFactorMap['default'];
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
this.tabs = {
|
||||
share: new mw.mmv.ui.reuse.Share( this.$reuseDialog ),
|
||||
download: new mw.mmv.ui.reuse.Download( this.$reuseDialog ),
|
||||
embed: new mw.mmv.ui.reuse.Embed( this.$reuseDialog ),
|
||||
embed: new mw.mmv.ui.reuse.Embed( this.$reuseDialog )
|
||||
};
|
||||
|
||||
shareTab = new oo.ui.MenuItemWidget(
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
this.sandbox.stub( logger, 'loadDependencies' ).returns( $.Deferred().resolve() );
|
||||
this.sandbox.stub( mw, 'log' );
|
||||
|
||||
logger.samplingFactorMap = { default : 1 };
|
||||
logger.samplingFactorMap = { 'default' : 1 };
|
||||
logger.setEventLog( fakeEventLog );
|
||||
logger.logActions = {};
|
||||
logger.logActions[ action1key ] = action1value;
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
|
||||
this.sandbox.stub( mw.loader, 'using' );
|
||||
|
||||
mw.loader.using.withArgs( [ 'ext.eventLogging', 'schema.MultimediaViewerDuration' ] ).throws( 'EventLogging is missing' );
|
||||
mw.loader.using.withArgs( [ 'ext.eventLogging', 'schema.MultimediaViewerDuration' ] )['throws']( 'EventLogging is missing' );
|
||||
|
||||
promise = durationLogger.loadDependencies();
|
||||
|
||||
|
@ -128,7 +128,7 @@
|
|||
mw.loader.using.restore();
|
||||
this.sandbox.stub( mw.loader, 'using' );
|
||||
|
||||
mw.loader.using.withArgs( [ 'ext.eventLogging', 'schema.MultimediaViewerDuration' ] ).throws( 'EventLogging is missing' );
|
||||
mw.loader.using.withArgs( [ 'ext.eventLogging', 'schema.MultimediaViewerDuration' ] )['throws']( 'EventLogging is missing' );
|
||||
|
||||
promise = durationLogger.loadDependencies();
|
||||
|
||||
|
|
|
@ -372,7 +372,7 @@
|
|||
animateTo : this.sandbox.stub(),
|
||||
jumpTo : this.sandbox.stub()
|
||||
},
|
||||
empty: $.noop,
|
||||
empty: $.noop
|
||||
},
|
||||
open : $.noop,
|
||||
empty: $.noop };
|
||||
|
|
|
@ -156,7 +156,7 @@
|
|||
} );
|
||||
|
||||
QUnit.asyncTest( 'GlobalUsage useApi test', 3, function ( assert ) {
|
||||
var api = { get: this.sandbox.stub().throws( 'API was invoked' ) },
|
||||
var api = { get: this.sandbox.stub()['throws']( 'API was invoked' ) },
|
||||
options = { useApi: false },
|
||||
file = new mw.Title( 'File:Stuff.jpg' ),
|
||||
globalUsageProvider = new mw.mmv.provider.GlobalUsage( api, options );
|
||||
|
|
|
@ -150,7 +150,7 @@
|
|||
} );
|
||||
|
||||
QUnit.asyncTest( 'UserInfo fake test', 4, function ( assert ) {
|
||||
var api = { get: this.sandbox.stub().throws( 'API was invoked' ) },
|
||||
var api = { get: this.sandbox.stub()['throws']( 'API was invoked' ) },
|
||||
username = 'Catrope',
|
||||
repoInfo = {},
|
||||
userInfoProvider = new mw.mmv.provider.UserInfo( api, { useApi: false } );
|
||||
|
|
|
@ -119,7 +119,7 @@
|
|||
canvas = new mw.mmv.ui.Canvas( $qf );
|
||||
|
||||
imageRawMetadata.filePageTitle = {
|
||||
getExtension: function() { return 'svg'; },
|
||||
getExtension: function() { return 'svg'; }
|
||||
};
|
||||
canvas.imageRawMetadata = imageRawMetadata;
|
||||
|
||||
|
@ -149,7 +149,7 @@
|
|||
canvas = new mw.mmv.ui.Canvas( $qf );
|
||||
|
||||
imageRawMetadata.filePageTitle = {
|
||||
getExtension: function() { return 'png'; },
|
||||
getExtension: function() { return 'png'; }
|
||||
};
|
||||
canvas.imageRawMetadata = imageRawMetadata;
|
||||
|
||||
|
@ -179,7 +179,7 @@
|
|||
canvas = new mw.mmv.ui.Canvas( $qf );
|
||||
|
||||
imageRawMetadata.filePageTitle = {
|
||||
getExtension: function() { return 'png'; },
|
||||
getExtension: function() { return 'png'; }
|
||||
};
|
||||
canvas.imageRawMetadata = imageRawMetadata;
|
||||
|
||||
|
@ -209,7 +209,7 @@
|
|||
canvas = new mw.mmv.ui.Canvas( $qf );
|
||||
|
||||
imageRawMetadata.filePageTitle = {
|
||||
getExtension: function() { return 'png'; },
|
||||
getExtension: function() { return 'png'; }
|
||||
};
|
||||
canvas.imageRawMetadata = imageRawMetadata;
|
||||
|
||||
|
@ -239,7 +239,7 @@
|
|||
canvas = new mw.mmv.ui.Canvas( $qf );
|
||||
|
||||
imageRawMetadata.filePageTitle = {
|
||||
getExtension: function() { return 'png'; },
|
||||
getExtension: function() { return 'png'; }
|
||||
};
|
||||
canvas.imageRawMetadata = imageRawMetadata;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
'$usernameLi',
|
||||
'$locationLi',
|
||||
'$repoLi',
|
||||
'$datetimeLi',
|
||||
'$datetimeLi'
|
||||
];
|
||||
|
||||
QUnit.module( 'mmv.ui.metadataPanel', QUnit.newMwEnvironment() );
|
||||
|
|
Loading…
Reference in a new issue