From: Bartosz DziewoƄski Date: Thu, 27 Apr 2017 18:05:25 +0000 (+0200) Subject: SpecialJavaScriptTest: Format long JavaScript code fragments X-Git-Tag: 1.31.0-rc.0~3396^2~2 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=449aea52448d9080fea9aea706090cdc95c68f1a;p=lhc%2Fweb%2Fwiklou.git SpecialJavaScriptTest: Format long JavaScript code fragments Change-Id: Iaa6369467e9fa846a8d5eb8f43cf0b523ef1a64e --- diff --git a/includes/specials/SpecialJavaScriptTest.php b/includes/specials/SpecialJavaScriptTest.php index dc6a619750..6fbac8a448 100644 --- a/includes/specials/SpecialJavaScriptTest.php +++ b/includes/specials/SpecialJavaScriptTest.php @@ -134,14 +134,20 @@ class SpecialJavaScriptTest extends SpecialPage { // Catch exceptions (such as "dependency missing" or "unknown module") so that we // always start QUnit. Re-throw so that they are caught and reported as global exceptions // by QUnit and Karma. - $code .= '(function () {' - . 'var start = window.__karma__ ? window.__karma__.start : QUnit.start;' - . 'try {' - . 'mw.loader.using( ' . Xml::encodeJsVar( $modules ) . ' )' - . '.always( start )' - . '.fail( function ( e ) { throw e; } );' - . '} catch ( e ) { start(); throw e; }' - . '}());'; + $modules = Xml::encodeJsVar( $modules ); + $code .= <<