Index: branches/resourceloader/phase3/resources/mw/mw.js |
— | — | @@ -199,19 +199,15 @@ |
200 | 200 | ) { |
201 | 201 | // Allow modules to be implemented without prior registration |
202 | 202 | 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] = {}; |
208 | 204 | } |
209 | | - // Attach script |
| 205 | + // Mark module as loaded |
| 206 | + registry[name].state = 'loaded'; |
| 207 | + // Attach components |
210 | 208 | registry[name].script = script; |
211 | | - // Attach style, if any |
212 | 209 | if ( typeof style === 'string' ) { |
213 | 210 | implementations[name].style = style; |
214 | 211 | } |
215 | | - // Attach localization, if any |
216 | 212 | if ( typeof localization === 'object' ) { |
217 | 213 | implementations[name].localization = localization; |
218 | 214 | } |