File tree Expand file tree Collapse file tree 4 files changed +2
-22
lines changed Expand file tree Collapse file tree 4 files changed +2
-22
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,6 @@ class CodeGenerationResults {
2727 * @returns {CodeGenerationResult } the CodeGenerationResult
2828 */
2929get ( module , runtime ) {
30- this . _verifyAlive ( ) ;
3130const entry = this . map . get ( module ) ;
3231if ( entry === undefined ) {
3332throw new Error (
@@ -73,7 +72,6 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
7372 * @returns {boolean } true, when we have data for this
7473 */
7574has ( module , runtime ) {
76- this . _verifyAlive ( ) ;
7775const entry = this . map . get ( module ) ;
7876if ( entry === undefined ) {
7977return false ;
@@ -144,23 +142,9 @@ Caller might not support runtime-dependent code generation (opt-out via optimiza
144142 * @returns {void }
145143 */
146144add ( module , runtime , result ) {
147- this . _verifyAlive ( ) ;
148145const map = provide ( this . map , module , ( ) => new RuntimeSpecMap ( ) ) ;
149146map . set ( runtime , result ) ;
150147}
151-
152- _verifyAlive ( ) {
153- if ( this . map === undefined ) {
154- throw new Error (
155- "CodeGenerationResults has been accessed after its lifetime. They are no longer available after sealing the compilation."
156- ) ;
157- }
158- }
159-
160- dispose ( ) {
161- this . map . clear ( ) ;
162- this . map = undefined ;
163- }
164148}
165149
166150module . exports = CodeGenerationResults ;
Original file line number Diff line number Diff line change @@ -2132,7 +2132,6 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
21322132this . assets = { } ;
21332133this . assetsInfo . clear ( ) ;
21342134this . moduleGraph . removeAllModuleAttributes ( ) ;
2135- this . codeGenerationResults = undefined ;
21362135}
21372136
21382137/**
@@ -2419,7 +2418,6 @@ Or do you want to use the entrypoints '${name}' and '${runtime}' independently o
24192418this . unseal ( ) ;
24202419return this . seal ( callback ) ;
24212420}
2422- this . codeGenerationResults . dispose ( ) ;
24232421return this . hooks . afterSeal . callAsync ( err => {
24242422if ( err ) {
24252423return callback (
Original file line number Diff line number Diff line change @@ -359,13 +359,12 @@ class Compiler {
359359// e.g. move compilation specific info from Modules into ModuleGraph
360360_cleanupLastCompilation ( ) {
361361if ( this . _lastCompilation !== undefined ) {
362- const c = this . _lastCompilation ;
363- for ( const module of c . modules ) {
362+ for ( const module of this . _lastCompilation . modules ) {
364363ChunkGraph . clearChunkGraphForModule ( module ) ;
365364ModuleGraph . clearModuleGraphForModule ( module ) ;
366365module . cleanupForCache ( ) ;
367366}
368- for ( const chunk of c . chunks ) {
367+ for ( const chunk of this . _lastCompilation . chunks ) {
369368ChunkGraph . clearChunkGraphForChunk ( chunk ) ;
370369}
371370this . _lastCompilation = undefined ;
Original file line number Diff line number Diff line change @@ -1174,7 +1174,6 @@ declare abstract class CodeGenerationResults {
11741174getData ( module : Module , runtime : RuntimeSpec , key : string ) : any ;
11751175getHash ( module : Module , runtime : RuntimeSpec ) : any ;
11761176add ( module : Module , runtime : RuntimeSpec , result : CodeGenerationResult ) : void ;
1177- dispose ( ) : void ;
11781177}
11791178type CodeValue =
11801179| undefined
You can’t perform that action at this time.
0 commit comments