From: Ori Livneh Date: Wed, 25 Sep 2013 16:06:41 +0000 (-0700) Subject: ResourceLoader: expose registry as mediaWiki.loader.moduleRegistry X-Git-Tag: 1.31.0-rc.0~18686^2 X-Git-Url: https://git.cyclocoop.org//%22?a=commitdiff_plain;h=9374fb34ef34d855e8d9c621547b2c09527b1950;p=lhc%2Fweb%2Fwiklou.git ResourceLoader: expose registry as mediaWiki.loader.moduleRegistry This patch exports the ResourceLoader registry object as a public member of mw.loader. I understand that it is not properly a part of the public API ResourceLoader exposes to JavaScript code; it is an internal data structure and ResourceLoader does not expect to have anything modify it except ResourceLoader itself. At the same time, it provides a trove of extremely valuable data for debugging and profiling, and it's annoying as hell not to be able to poke and prod it from the JS console. So my hope is that we do the Python thing of treating 'private' as a tip and social convention rather than something that is enforced by the code. Change-Id: I1c47970aa9fceb0b2ded9008efc926b46fa08f51 --- diff --git a/resources/mediawiki/mediawiki.js b/resources/mediawiki/mediawiki.js index 741e2314a7..d1a541ed49 100644 --- a/resources/mediawiki/mediawiki.js +++ b/resources/mediawiki/mediawiki.js @@ -1205,6 +1205,16 @@ var mw = ( function ( $, undefined ) { /* Public Methods */ return { + /** + * The module registry is exposed as an aid for debugging and inspecting page + * state; it is not a public interface for modifying the registry. + * + * @see #registry + * @property + * @private + */ + moduleRegistry: registry, + /** * @inheritdoc #newStyleTag * @method