Index: trunk/phase3/resources/mediawiki/mediawiki.js |
— | — | @@ -630,8 +630,12 @@ |
631 | 631 | if ( typeof dependencies === 'string' ) { |
632 | 632 | dependencies = [dependencies]; |
633 | 633 | if ( dependencies[0] in registry ) { |
634 | | - for ( var n = 0; n < registry[dependencies[0]].dependencies.length; n++ ) { |
635 | | - dependencies[dependencies.length] = registry[dependencies[0]].dependencies[n]; |
| 634 | + // Cache repetitively accessed deep level object member |
| 635 | + var regItemDeps = registry[dependencies[0]].dependencies, |
| 636 | + // Cache to avoid looped access to length property |
| 637 | + regItemDepLen = regItemDeps.length; |
| 638 | + for ( var n = 0; n < regItemDepLen; n++ ) { |
| 639 | + dependencies[dependencies.length] = regItemDeps[n]; |
636 | 640 | } |
637 | 641 | } |
638 | 642 | } |