File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -448,16 +448,19 @@ class Chunk {
448448
449449 checkConstraints ( ) {
450450 const chunk = this ;
451- chunk . _chunks . forEach ( ( child , idx ) => {
452- if ( Array . from ( chunk . _chunks ) . indexOf ( child ) !== idx )
451+ const chunks = Array . from ( chunk . _chunks ) ;
452+ chunks . forEach ( ( child , idx ) => {
453+ if ( chunks . indexOf ( child ) !== idx )
453454 throw new Error ( `checkConstraints: duplicate child in chunk ${ chunk . debugId } ${ child . debugId } ` ) ;
454455 if ( child . parents . indexOf ( chunk ) < 0 )
455456 throw new Error ( `checkConstraints: child missing parent ${ chunk . debugId } -> ${ child . debugId } ` ) ;
456457 } ) ;
457458 chunk . parents . forEach ( ( parentChunk , idx ) => {
458459 if ( chunk . parents . indexOf ( parentChunk ) !== idx )
459460 throw new Error ( `checkConstraints: duplicate parent in chunk ${ chunk . debugId } ${ parentChunk . debugId } ` ) ;
460- if ( parentChunk . _chunks . indexOf ( chunk ) < 0 )
461+
462+ const chunks = Array . from ( parentChunk . _chunks ) ;
463+ if ( chunks . indexOf ( chunk ) < 0 )
461464 throw new Error ( `checkConstraints: parent missing child ${ parentChunk . debugId } <- ${ chunk . debugId } ` ) ;
462465 } ) ;
463466 }
Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ describe("Chunk", () => {
128128 } ) ;
129129 describe ( "and the chunk does contain this module" , function ( ) {
130130 beforeEach ( function ( ) {
131- ChunkInstance . chunks = [ chunk ] ;
131+ ChunkInstance . _chunks = new Set ( [ chunk ] ) ;
132132 } ) ;
133133 it ( "calls module.removeChunk with itself and returns true" , function ( ) {
134134 ChunkInstance . removeChunk ( chunk ) . should . eql ( true ) ;
You can’t perform that action at this time.
0 commit comments