mw.hook: Make hook.fire actually chainable
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 4 Apr 2014 01:35:33 +0000 (18:35 -0700)
committerOri.livneh <ori@wikimedia.org>
Fri, 4 Apr 2014 18:33:50 +0000 (18:33 +0000)
commit9674a17c0f3b5ef50ea572bdcbd4b277aa3d956d
tree9cc8bd2cee74c4a6a42eb62c5e1357681764823c
parent50f4b6778ebdca53da1e67b5c7d9c74aa98af120
mw.hook: Make hook.fire actually chainable

It was being called without being bound to the mw.hook instance,
as such the (detachable) callbackList.fireWith method (which
returns its given 'this') returned the callbackList instance
instead of the mw.hook object literal.

The tests weren't catching it because it was just checking one
can call .fire() without it crashing, but it was in fact calling
list.fire instead of hook.fire (which unlike #add and #remove are
not compatible, and we might add new methods later on).

Change-Id: If3d4dfbed494e7ff9f32514e539cfa089aea18ac
resources/mediawiki/mediawiki.js
tests/qunit/suites/resources/mediawiki/mediawiki.test.js