From 9374fb34ef34d855e8d9c621547b2c09527b1950 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Wed, 25 Sep 2013 09:06:41 -0700 Subject: [PATCH] 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 --- resources/mediawiki/mediawiki.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- 2.20.1