r68427 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68426‎ | r68427 | r68428 >
Date:19:47, 22 June 2010
Author:tparscal
Status:ok
Tags:
Comment:
Simplified some code
Modified paths:
  • /branches/resourceloader/phase3/resources/mw/mw.js (modified) (history)

Diff [purge]

Index: branches/resourceloader/phase3/resources/mw/mw.js
@@ -199,19 +199,15 @@
200200 ) {
201201 // Allow modules to be implemented without prior registration
202202 if ( typeof registry[name] === 'undefined' ) {
203 - // Automatically register as loaded, assuming no requirements
204 - registry[name] = { 'state': 'loaded' };
205 - } else {
206 - // If it was already registered, let's make sure we mark it as loaded
207 - registry[name].state = 'loaded';
 203+ registry[name] = {};
208204 }
209 - // Attach script
 205+ // Mark module as loaded
 206+ registry[name].state = 'loaded';
 207+ // Attach components
210208 registry[name].script = script;
211 - // Attach style, if any
212209 if ( typeof style === 'string' ) {
213210 implementations[name].style = style;
214211 }
215 - // Attach localization, if any
216212 if ( typeof localization === 'object' ) {
217213 implementations[name].localization = localization;
218214 }

Status & tagging log