resourceloader: Remove closure around $CODE.defineLoader()
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 8 Sep 2018 18:01:45 +0000 (19:01 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Sat, 8 Sep 2018 21:45:03 +0000 (22:45 +0100)
commit4b069cdc1e4b408f240551be33940b751035d437
tree1ea2310777dc96ddae5357dbcab71dd5dfe1b63e
parent20edb6381aa0bd179239bf9de51339bbcce9d3d5
resourceloader: Remove closure around $CODE.defineLoader()

Follows-up b7b84d55d4e, which embedded the whole of the three 'mediawiki'
JS files inside of startup.js, but did so inside of the pre-existing
closure that was there.

This adds some overhead we don't get value of, so best to remove
it and embed it as a sibling of startup.js in the same top-level
scope.

In local testing (Chrome stable, CPU 1/6th) this reduced startup
run-time from 73-78ms to 63-65ms.

Also:
* Declare isCompatible() as a normal function.
  Disable the implicit-globals warning given this isn't a regular module,
  this file is  intentionally in the global scope.
* Unfold the private startUp() function to its call site.

Change-Id: Ida51ab20898c9e4ae6cbf7ad2968d88d824a1483
resources/src/startup/startup.js
tests/phpunit/includes/resourceloader/ResourceLoaderTest.php