r70467 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70466‎ | r70467 | r70468 >
Date:17:36, 4 August 2010
Author:tparscal
Status:ok
Tags:
Comment:
Fixed mixed use of spaces and tabs for indentation. Resolves indentation mistakes made in r70358.
Modified paths:
  • /branches/resourceloader/phase3/resources/mediawiki/mediawiki.js (modified) (history)

Diff [purge]

Index: branches/resourceloader/phase3/resources/mediawiki/mediawiki.js
@@ -16,20 +16,20 @@
1717 // Add array comparison functionality
1818 if ( typeof Array.prototype.compare === 'undefined' ) {
1919 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;
3434 };
3535 }
3636
@@ -188,18 +188,18 @@
189189 */
190190 function recurse( module, resolved, unresolved ) {
191191 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 );
204204 }
205205 /**
206206 * Gets a list of modules names that a module needs in their proper dependency order

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r70358Enabled optionally defining modules needs in PHP, which are then generated in...tparscal21:17, 2 August 2010

Status & tagging log