mediawiki.api: Simplify mw.Api constructor
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 10 Jul 2018 04:14:28 +0000 (21:14 -0700)
committerKrinkle <krinklemail@gmail.com>
Tue, 10 Jul 2018 17:02:20 +0000 (17:02 +0000)
commitfc21cbc4009a7f00d650c0d4e01f5993c0bebe3a
treeb0a497888a6cb8f66b53c0f1b7933a54d2ccf080
parent60557e0370980e23a9f07ab412ccd73e10223652
mediawiki.api: Simplify mw.Api constructor

* Use a different variable for the argument and the created
  'defaults' object for this instance.

* Don't modify the given object (it could previously modify
  the 'ajax.url' property).

* Make the 'useUS' logic more explicit and merge it with the
  'ajax.url'  handling, that it previously reacted to.

Change-Id: Ib1f50876359152935b8cb9b021ea0a95915808e2
resources/src/mediawiki.api/index.js