mw.loader: Create 'skipped' property in registry for debugging
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 16 Jul 2014 02:14:17 +0000 (04:14 +0200)
committerOri.livneh <ori@wikimedia.org>
Sat, 19 Jul 2014 23:20:48 +0000 (23:20 +0000)
Follows-up 75c08916b02ac8706.

Makes it easier to debug when a module is skipped as right now
they are indistinguishable from regularly loaded modules (other
then checking the network for load.php requests, though those
may not show up either if mw.loader.store is used).

Change-Id: Ic7d2efbf74e0fbf1334f02ecad797e63d0ae2857

resources/src/mediawiki/mediawiki.js

index 57838d4..a0098d0 100644 (file)
                         *             'skip': 'return !!window.Example', (or) null
                         *
                         *             // Added during implementation
+                        *             'skipped': true,
                         *             'script': ...,
                         *             'style': ...,
                         *             'messages': { 'key': 'value' },
                                        skip = new Function( registry[module].skip );
                                        registry[module].skip = null;
                                        if ( skip() ) {
+                                               registry[module].skipped = true;
                                                registry[module].dependencies = [];
                                                registry[module].state = 'ready';
                                                handlePending( module );