Merge "Add support for 'hu-formal'"
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.inspect.js
index 006ca1f..6478fd9 100644 (file)
@@ -10,6 +10,7 @@
 ( function ( mw, $ ) {
 
        var inspect,
+               byteLength = require( 'mediawiki.String' ).byteLength,
                hasOwn = Object.prototype.hasOwnProperty;
 
        function sortByProperty( array, prop, descending ) {
@@ -55,7 +56,7 @@
                                }
                                graph[ moduleName ].requires = dependencies;
 
-                               $.each( dependencies, function ( depIndex, depName ) {
+                               dependencies.forEach( function ( depName ) {
                                        if ( !hasOwn.call( graph, depName ) ) {
                                                graph[ depName ] = { requiredBy: [] };
                                        }
                        size = 0;
                        for ( i = 0; i < args.length; i++ ) {
                                if ( typeof args[ i ] === 'function' ) {
-                                       size += $.byteLength( getFunctionBody( args[ i ] ) );
+                                       size += byteLength( getFunctionBody( args[ i ] ) );
                                } else {
-                                       size += $.byteLength( JSON.stringify( args[ i ] ) );
+                                       size += byteLength( JSON.stringify( args[ i ] ) );
                                }
                        }
 
                                        $.extend( stats, mw.loader.store.stats );
                                        try {
                                                raw = localStorage.getItem( mw.loader.store.getStoreKey() );
-                                               stats.totalSizeInBytes = $.byteLength( raw );
-                                               stats.totalSize = humanSize( $.byteLength( raw ) );
+                                               stats.totalSizeInBytes = byteLength( raw );
+                                               stats.totalSize = humanSize( byteLength( raw ) );
                                        } catch ( e ) {}
                                }
                                return [ stats ];