Merge "Pass $context to 'GetPreferences' hook"
[lhc/web/wiklou.git] / resources / src / mediawiki.base / mediawiki.base.js
index 16994f5..8a44dcc 100644 (file)
                } );
        };
 
-       // Fire events from before track() triggred fire()
+       // Fire events from before track() triggered fire()
        trackCallbacks.fire( mw.trackQueue );
 
        /**
                                                } else if ( contents instanceof this.Cdata ) {
                                                        // CDATA
                                                        if ( /<\/[a-zA-z]/.test( contents.value ) ) {
-                                                               throw new Error( 'mw.html.element: Illegal end tag found in CDATA' );
+                                                               throw new Error( 'Illegal end tag found in CDATA' );
                                                        }
                                                        s += contents.value;
                                                } else {
-                                                       throw new Error( 'mw.html.element: Invalid type of contents' );
+                                                       throw new Error( 'Invalid type of contents' );
                                                }
                                }
                                s += '</' + name + '>';
        mw.log.deprecate( window, '$j', $, 'Use $ or jQuery instead.' );
 
        // Process callbacks for Grade A that require modules.
-       // Plain ones were already processed by startup.js.
        queue = window.RLQ;
-       // Redefine publicly to capture any late arrivals
+       // Replace temporary RLQ implementation from startup.js with the
+       // final implementation that also processes callbacks that can
+       // require modules. It must also support late arrivals of
+       // plain callbacks. (T208093)
        window.RLQ = {
                push: function ( entry ) {
-                       mw.loader.using( entry[ 0 ], entry[ 1 ] );
+                       if ( typeof entry === 'function' ) {
+                               entry();
+                       } else {
+                               mw.loader.using( entry[ 0 ], entry[ 1 ] );
+                       }
                }
        };
        while ( queue[ 0 ] ) {