From 449aea52448d9080fea9aea706090cdc95c68f1a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Thu, 27 Apr 2017 20:05:25 +0200 Subject: [PATCH] SpecialJavaScriptTest: Format long JavaScript code fragments Change-Id: Iaa6369467e9fa846a8d5eb8f43cf0b523ef1a64e --- includes/specials/SpecialJavaScriptTest.php | 22 +++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) 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 .= <<