This way we'll be able to use a mw.ForeignApi here
(being introduced in Ic20b9682d28633baa87d22e6e9fb71ce507da58d).
Change-Id: Ie49d7dad5abfe567f9b9c7396f8e132875568fd3
* } );
*
* @constructor
- * @param {Object} apiconfig Passed to the constructor of mw.Api.
+ * @param {Object|mw.Api} [apiconfig] A mw.Api object (or subclass), or configuration
+ * to pass to the constructor of mw.Api.
*/
function Upload( apiconfig ) {
- this.api = new mw.Api( apiconfig );
+ this.api = ( apiconfig instanceof mw.Api ) ? apiconfig : new mw.Api( apiconfig );
this.watchlist = false;
this.text = '';