resourceloader: Switch Xml::encodeJsCall call in getDeprecationInformation
[lhc/web/wiklou.git] / includes / resourceloader / ResourceLoaderModule.php
index aca5c73..0baed65 100644 (file)
@@ -146,10 +146,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
                        if ( is_string( $deprecationInfo ) ) {
                                $warning .= "\n" . $deprecationInfo;
                        }
-                       return Xml::encodeJsCall(
-                               'mw.log.warn',
-                               [ $warning ]
-                       );
+                       return 'mw.log.warn(' . ResourceLoader::encodeJsonForScript( $warning ) . ');';
                } else {
                        return '';
                }
@@ -182,7 +179,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
        /**
         * Takes named templates by the module and returns an array mapping.
         *
-        * @return array of templates mapping template alias to content
+        * @return string[] Array of templates mapping template alias to content
         */
        public function getTemplates() {
                // Stub, override expected.
@@ -504,10 +501,11 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
                                        'md_skin' => $vary,
                                        'md_deps' => $deps,
                                ],
-                               [ 'md_module', 'md_skin' ],
+                               [ [ 'md_module', 'md_skin' ] ],
                                [
                                        'md_deps' => $deps,
-                               ]
+                               ],
+                               __METHOD__
                        );
 
                        if ( $dbw->trxLevel() ) {
@@ -953,8 +951,7 @@ abstract class ResourceLoaderModule implements LoggerAwareInterface {
                $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
                return $cache->getWithSetCallback(
                        $cache->makeGlobalKey(
-                               'resourceloader',
-                               'jsparse',
+                               'resourceloader-jsparse',
                                self::$parseCacheVersion,
                                md5( $contents ),
                                $fileName