resourceloader: Simplify and clean up RLQ wrap
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 21 Jan 2016 17:25:14 +0000 (17:25 +0000)
committerOri.livneh <ori@wikimedia.org>
Wed, 27 Jan 2016 02:03:00 +0000 (02:03 +0000)
commit0c8101570c3c1c9df01efc6a4fac1441ff080389
tree5f00e2bf7be85a3ed9744aa3334a0aaf13d33109
parent534b28dbaff2b226de85c1dc7d8d151c0d0b3368
resourceloader: Simplify and clean up RLQ wrap

startup.js:
* Don't assign to "window.RLQ" and read from "RLQ". Use the same
  identifier in both places instead of relying on global scope.
* Create the global window.RLQ only once. The temporary [] fallback
  doesn't need to be exposed globally, so use a local variable for
  the loop that processes the pre-existing queue built up while
  the startup module was loading.

OutputPage:
* Simplify the RLQ wrap to be more idiomatic and less repetitive.
  Matches the pattern used in Google and Facebook open-source projects.

Change-Id: I9176377bc05432e51add841696a356428feec8ce
includes/resourceloader/ResourceLoader.php
resources/src/startup.js
tests/phpunit/includes/OutputPageTest.php