Index: branches/resourceloader/phase3/resources/mediawiki/mediawiki.js |
— | — | @@ -16,20 +16,20 @@ |
17 | 17 | // Add array comparison functionality |
18 | 18 | if ( typeof Array.prototype.compare === 'undefined' ) { |
19 | 19 | Array.prototype.compare = function( against ) { |
20 | | - if ( this.length != against.length ) { |
21 | | - return false; |
22 | | - } |
23 | | - for ( var i = 0; i < against.length; i++ ) { |
24 | | - if ( this[i].compare ) { |
25 | | - if ( !this[i].compare( against[i] ) ) { |
26 | | - return false; |
27 | | - } |
28 | | - } |
29 | | - if ( this[i] !== against[i] ) { |
30 | | - return false; |
31 | | - } |
32 | | - } |
33 | | - return true; |
| 20 | + if ( this.length != against.length ) { |
| 21 | + return false; |
| 22 | + } |
| 23 | + for ( var i = 0; i < against.length; i++ ) { |
| 24 | + if ( this[i].compare ) { |
| 25 | + if ( !this[i].compare( against[i] ) ) { |
| 26 | + return false; |
| 27 | + } |
| 28 | + } |
| 29 | + if ( this[i] !== against[i] ) { |
| 30 | + return false; |
| 31 | + } |
| 32 | + } |
| 33 | + return true; |
34 | 34 | }; |
35 | 35 | } |
36 | 36 | |
— | — | @@ -188,18 +188,18 @@ |
189 | 189 | */ |
190 | 190 | function recurse( module, resolved, unresolved ) { |
191 | 191 | unresolved[unresolved.length] = module; |
192 | | - for ( var n = 0; n < registry[module].needs.length; n++ ) { |
193 | | - if ( resolved.indexOf( registry[module].needs[n] ) === -1 ) { |
194 | | - if ( unresolved.indexOf( registry[module].needs[n] ) !== -1 ) { |
195 | | - throw new Error( |
196 | | - 'Circular reference detected: ' + module + ' -> ' + registry[module].needs[n] |
197 | | - ); |
198 | | - } |
199 | | - recurse( registry[module].needs[n], resolved, unresolved ); |
200 | | - } |
201 | | - } |
202 | | - resolved[resolved.length] = module; |
203 | | - unresolved.splice( unresolved.indexOf( module ), 1 ); |
| 192 | + for ( var n = 0; n < registry[module].needs.length; n++ ) { |
| 193 | + if ( resolved.indexOf( registry[module].needs[n] ) === -1 ) { |
| 194 | + if ( unresolved.indexOf( registry[module].needs[n] ) !== -1 ) { |
| 195 | + throw new Error( |
| 196 | + 'Circular reference detected: ' + module + ' -> ' + registry[module].needs[n] |
| 197 | + ); |
| 198 | + } |
| 199 | + recurse( registry[module].needs[n], resolved, unresolved ); |
| 200 | + } |
| 201 | + } |
| 202 | + resolved[resolved.length] = module; |
| 203 | + unresolved.splice( unresolved.indexOf( module ), 1 ); |
204 | 204 | } |
205 | 205 | /** |
206 | 206 | * Gets a list of modules names that a module needs in their proper dependency order |