jenkins-bot has submitted this change and it was merged. Change subject: ResourceLoaderStartUpModule: Remove no-op "delete isCompatible" ......................................................................
ResourceLoaderStartUpModule: Remove no-op "delete isCompatible" Due to the way this function being defined as a function or var declaration instead of a function expression assigned to a property it can't be deleted. JavaScript doesn't throw an error when deletion is not permitted though, the operator returns false instead. > delete isCompatible; false We already removed 'delete startUp' from mediawiki.js in favour of startUp = undefined; (r107402, r74325). Change-Id: I7aa02e3f4deb3a4f00177b70978bfcb83c80988a --- M includes/resourceloader/ResourceLoaderStartUpModule.php 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Bartosz Dziewoński: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 64fafd7..3482bfa 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -234,8 +234,9 @@ // Startup function $configuration = $this->getConfig( $context ); $registrations = self::getModuleRegistrations( $context ); - $registrations = str_replace( "\n", "\n\t", trim( $registrations ) ); // fix indentation - $out .= "var startUp = function() {\n" . + // Fix indentation + $registrations = str_replace( "\n", "\n\t", trim( $registrations ) ); + $out .= "var startUp = function () {\n" . "\tmw.config = new " . Xml::encodeJsCall( 'mw.Map', array( $wgLegacyJavaScriptGlobals ) ) . "\n" . "\t$registrations\n" . "\t" . Xml::encodeJsCall( 'mw.config.set', array( $configuration ) ) . @@ -245,8 +246,7 @@ $scriptTag = Html::linkedScript( self::getStartupModulesUrl( $context ) ); $out .= "if ( isCompatible() ) {\n" . "\t" . Xml::encodeJsCall( 'document.write', array( $scriptTag ) ) . - "}\n" . - "delete isCompatible;"; + "}"; } return $out; -- To view, visit https://gerrit.wikimedia.org/r/119696 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7aa02e3f4deb3a4f00177b70978bfcb83c80988a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Bartosz Dziewoński <matma....@gmail.com> Gerrit-Reviewer: Catrope <roan.katt...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits