resourceloader: Convert inline statements to queued functions
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 27 Jul 2015 23:40:52 +0000 (16:40 -0700)
committerOri.livneh <ori@wikimedia.org>
Thu, 30 Jul 2015 18:22:46 +0000 (18:22 +0000)
commit59f1a1efa87f6e1563ad899f3aefeda59625d6d6
treed9f73e96cc1c427688ba6bc79a23bdc449c87aca
parentb80bcaaba3f8422637d3de4204ae75eaf5ea1bbe
resourceloader: Convert inline statements to queued functions

Instead of having inline statements be plain statements wrapped
in an if-conditional block, convert them to inline functions
pushed into a queue.

The queue is kept in-memory until the startup module is loaded
at which point it transforms into a function that is immediately
invoked.

This is a prerequisite to making the top queue asynchronous.
Until then these functions will just run immediately as they
occur in the HTML after the startup module.

This is based on the previously reverted commit e86e5f8460.

Bug: T107399
Change-Id: Ifb38efca219c10ab973ad4c4ebb21c6a4239b005
includes/OutputPage.php
includes/resourceloader/ResourceLoader.php
resources/src/startup.js
tests/phpunit/includes/OutputPageTest.php