mediawiki.inspect: Fix exception when calling mw.inspect() a second time
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 26 Jun 2018 17:22:26 +0000 (18:22 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 26 Jun 2018 17:22:26 +0000 (18:22 +0100)
commit2e1b3f94ad3620c87d8f5587576628a56556054e
treec97edb90e635e0488218113658e3272f6b7763d9
parentcd13aea297f127ff244b11b29fea28367e2c8ed7
mediawiki.inspect: Fix exception when calling mw.inspect() a second time

In mediawiki.js, the mw.inspect() method is defined to lazy-load the
'mediawiki.inspect' module, and then call mw.inspect.runReports().

The problem is that, mediawiki.inspect.js, re-creates mw.inspect as a plain
object, which blows away the mw.inspect() function that was there.

Calling it a second time threw "TypeError: inspect is not a function".

Fix this by making mediawiki.inspect.js extend the function object,
instead of re-defining it.

Bug: T197810
Change-Id: I61aa965f3e1fd0a1c9f9d98310632b4a8d5e1683
resources/src/mediawiki.inspect.js