@@ -13,15 +13,15 @@ const Template = require("./Template");
1313
1414let debugId = 1000 ;
1515
16- class Module extends DependenciesBlock {
16+ const sortById = ( a , b ) => {
17+ return a . id - b . id ;
18+ } ;
1719
18- static sortById ( a , b ) {
19- return a . id - b . id ;
20- }
20+ const sortByDebugId = ( a , b ) => {
21+ return a . debugId - b . debugId ;
22+ } ;
2123
22- static sortByDebugId ( a , b ) {
23- return a . debugId - b . debugId ;
24- }
24+ class Module extends DependenciesBlock {
2525
2626 constructor ( ) {
2727 super ( ) ;
@@ -37,7 +37,7 @@ class Module extends DependenciesBlock {
3737 this . used = null ;
3838 this . usedExports = null ;
3939 this . providedExports = null ;
40- this . _chunks = new SortableSet ( undefined , Module . sortById ) ;
40+ this . _chunks = new SortableSet ( undefined , sortById ) ;
4141 this . _chunksDebugIdent = undefined ;
4242 this . warnings = [ ] ;
4343 this . dependenciesWarnings = [ ] ;
@@ -94,7 +94,7 @@ class Module extends DependenciesBlock {
9494
9595 getChunkIdsIdent ( ) {
9696 if ( this . _chunksDebugIdent !== undefined ) return this . _chunksDebugIdent ;
97- this . _chunks . sortWith ( Module . sortByDebugId ) ;
97+ this . _chunks . sortWith ( sortByDebugId ) ;
9898 const chunks = this . _chunks ;
9999 const list = [ ] ;
100100 for ( const chunk of chunks ) {
@@ -128,8 +128,8 @@ class Module extends DependenciesBlock {
128128
129129 hasEqualsChunks ( otherModule ) {
130130 if ( this . _chunks . size !== otherModule . _chunks . size ) return false ;
131- this . _chunks . sortWith ( Module . sortByDebugId ) ;
132- otherModule . _chunks . sortWith ( Module . sortByDebugId ) ;
131+ this . _chunks . sortWith ( sortByDebugId ) ;
132+ otherModule . _chunks . sortWith ( sortByDebugId ) ;
133133 const a = this . _chunks [ Symbol . iterator ] ( ) ;
134134 const b = otherModule . _chunks [ Symbol . iterator ] ( ) ;
135135 while ( true ) { // eslint-disable-line
@@ -206,7 +206,7 @@ class Module extends DependenciesBlock {
206206 super . sortItems ( ) ;
207207 if ( sortChunks )
208208 this . _chunks . sort ( ) ;
209- this . reasons . sort ( ( a , b ) => Module . sortById ( a . module , b . module ) ) ;
209+ this . reasons . sort ( ( a , b ) => sortById ( a . module , b . module ) ) ;
210210 if ( Array . isArray ( this . usedExports ) ) {
211211 this . usedExports . sort ( ) ;
212212 }
0 commit comments