resourceloader: Fix duplicate semi-colon in generated startup code
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 25 Jun 2018 18:25:36 +0000 (19:25 +0100)
committerKrinkle <krinklemail@gmail.com>
Mon, 25 Jun 2018 18:40:18 +0000 (18:40 +0000)
The startup.js template used '$CODE.registrations();', which makes
sense syntatically (and for the linter), but the substitution logic
was only replacing the '$CODE.registrations()' portion.

This made the generated output contain two consecutive semi-colons.

Change-Id: Ibef1a0d932b19037987a7effa12aa57f578a142d

includes/resourceloader/ResourceLoaderStartUpModule.php

index 4777545..120f559 100644 (file)
@@ -396,7 +396,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule {
                        // This url may be preloaded. See getPreloadLinks().
                        '$VARS.baseModulesUri' => self::getStartupModulesUrl( $context ),
                ] );
-               $pairs['$CODE.registrations()'] = str_replace(
+               $pairs['$CODE.registrations();'] = str_replace(
                        "\n",
                        "\n\t",
                        trim( $this->getModuleRegistrations( $context ) )