X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialJavaScriptTest.php;h=b786c869fb6d85f90b48dbaf23a92fb4326ccbd8;hb=4bd87fba840a3fa2ba8c6dbcfa7f005f6708c0fa;hp=dc6a61975066192df2bdf5e80b45de14d9e124c1;hpb=55043101b2a89ea1e811b6d35e415f57ed0bf41d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialJavaScriptTest.php b/includes/specials/SpecialJavaScriptTest.php index dc6a619750..b786c869fb 100644 --- a/includes/specials/SpecialJavaScriptTest.php +++ b/includes/specials/SpecialJavaScriptTest.php @@ -134,14 +134,26 @@ 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 .= <<