resourceloader: Make cache-eval in mw.loader.work asynchronous
authorTimo Tijhof <krinklemail@gmail.com>
Thu, 11 Aug 2016 01:39:30 +0000 (18:39 -0700)
committerKrinkle <krinklemail@gmail.com>
Wed, 31 Aug 2016 00:39:52 +0000 (00:39 +0000)
commit482ad8d9fb2e8273cefc4a5a557604b093944c8b
treed42210587e9b1af772d0b19440bde20afd2c8230
parent2bdd56e89334d85c48753b0052b0a94689dd584b
resourceloader: Make cache-eval in mw.loader.work asynchronous

* Add 'if !batch.length' in work() to avoid needless initialisation
  of mw.loader.store(). work() can be called without anything in
  the batch because using() will call enqueue() for any non-ready
  modules in order to get a job callback. This will invoke
  work() as side-effect but will have no work to do.

  This was previously here but got moved in 488c5d9.

* Add 'if !implementations.length' to avoid needless scheduling
  of an idle callback when none of the modules in the batch
  are found in local storage (e.g. first view).

Bug: T142129
Change-Id: Icd39423aec35f25162d2443b1f0507f6f0c748a3
resources/src/mediawiki/mediawiki.js