@@ -372,26 +372,19 @@ export class AngularCompilerPlugin implements Tapable {
372
372
} else {
373
373
time ( 'AngularCompilerPlugin._createOrUpdateProgram.ng.createProgram' ) ;
374
374
// Create the Angular program.
375
- try {
376
- this . _program = createProgram ( {
377
- rootNames : this . _tsFilenames ,
378
- options : this . _angularCompilerOptions ,
379
- host : this . _angularCompilerHost ,
380
- oldProgram : this . _program as Program
375
+ this . _program = createProgram ( {
376
+ rootNames : this . _tsFilenames ,
377
+ options : this . _angularCompilerOptions ,
378
+ host : this . _angularCompilerHost ,
379
+ oldProgram : this . _program as Program
380
+ } ) ;
381
+ timeEnd ( 'AngularCompilerPlugin._createOrUpdateProgram.ng.createProgram' ) ;
382
+
383
+ time ( 'AngularCompilerPlugin._createOrUpdateProgram.ng.loadNgStructureAsync' ) ;
384
+ return this . _program . loadNgStructureAsync ( )
385
+ . then ( ( ) => {
386
+ timeEnd ( 'AngularCompilerPlugin._createOrUpdateProgram.ng.loadNgStructureAsync' ) ;
381
387
} ) ;
382
- timeEnd ( 'AngularCompilerPlugin._createOrUpdateProgram.ng.createProgram' ) ;
383
-
384
- time ( 'AngularCompilerPlugin._createOrUpdateProgram.ng.loadNgStructureAsync' ) ;
385
- return this . _program . loadNgStructureAsync ( )
386
- . then ( ( ) => {
387
- timeEnd ( 'AngularCompilerPlugin._createOrUpdateProgram.ng.loadNgStructureAsync' ) ;
388
- } ) ;
389
- } catch ( e ) {
390
- // TODO: remove this when the issue is addressed.
391
- // Temporary workaround for https://github.com/angular/angular/issues/19951
392
- this . _program = undefined ;
393
- throw e ;
394
- }
395
388
}
396
389
} )
397
390
. then ( ( ) => {
@@ -731,10 +724,6 @@ export class AngularCompilerPlugin implements Tapable {
731
724
const changedTsFiles = this . _getChangedTsFiles ( ) ;
732
725
if ( this . _ngCompilerSupportsNewApi ) {
733
726
this . _processLazyRoutes ( this . _listLazyRoutesFromProgram ( ) ) ;
734
- // TODO: remove this when the issue is addressed.
735
- // Fix for a bug in compiler where the program needs to be updated after
736
- // _listLazyRoutesFromProgram is called.
737
- return this . _createOrUpdateProgram ( ) ;
738
727
} else if ( this . _firstRun ) {
739
728
this . _processLazyRoutes ( this . _getLazyRoutesFromNgtools ( ) ) ;
740
729
} else if ( changedTsFiles . length > 0 ) {
@@ -1002,9 +991,6 @@ export class AngularCompilerPlugin implements Tapable {
1002
991
this . writeI18nOutFile ( ) ;
1003
992
}
1004
993
timeEnd ( 'AngularCompilerPlugin._emit.ng.emit' ) ;
1005
- } else {
1006
- // Throw away the old program if there was an error.
1007
- this . _program = undefined ;
1008
994
}
1009
995
}
1010
996
} catch ( e ) {
0 commit comments