(bug 37331) Modules sometimes execute twice in Firefox
authorCatrope <roan.kattouw@gmail.com>
Tue, 24 Jul 2012 20:24:56 +0000 (13:24 -0700)
committerCatrope <roan.kattouw@gmail.com>
Mon, 30 Jul 2012 20:19:17 +0000 (13:19 -0700)
commit0c1471c59413225ae331256a3e952ad244f15536
tree84e309280b27b88ce29bd166d71300481197d1df
parent8122488aece256d89c550d7c5a3834cdc41173b6
(bug 37331) Modules sometimes execute twice in Firefox

This seems to have been caused by a weird race condition that caused the
loader to run while the module in question was also running; could also
have been caused by the module calling mw.loader, but that didn't seem
to be the case here.

The fix is to set .state='ready' before executing the module rather than
after. We can't do this in debug mode (where we're loading raw files and
can't execute things at will), but we have to do this in production
mode to prevent these freakish double executions.

Change-Id: I7e8dbd361fb265e520d3935e3a1fc7e3b6710b66
RELEASE-NOTES-1.20
resources/mediawiki/mediawiki.js
tests/qunit/suites/resources/mediawiki/mediawiki.test.js