fix(ivy): wait for preanalyze promises in loadNgStructureAsync() (#25080)
loadNgStructureAsync() for ngtsc has a bug where it returns a Promise<Promise[]> instead of awaiting the entire array of Promises. This commit uses Promise.all() to await the whole set. PR Close #25080
This commit is contained in:
parent
0d1d5898e3
commit
8de304c15a
|
@ -75,12 +75,11 @@ export class NgtscProgram implements api.Program {
|
|||
async loadNgStructureAsync(): Promise<void> {
|
||||
if (this.compilation === undefined) {
|
||||
this.compilation = this.makeCompilation();
|
||||
|
||||
await this.tsProgram.getSourceFiles()
|
||||
.filter(file => !file.fileName.endsWith('.d.ts'))
|
||||
.map(file => this.compilation !.analyzeAsync(file))
|
||||
.filter((result): result is Promise<void> => result !== undefined);
|
||||
}
|
||||
await Promise.all(this.tsProgram.getSourceFiles()
|
||||
.filter(file => !file.fileName.endsWith('.d.ts'))
|
||||
.map(file => this.compilation !.analyzeAsync(file))
|
||||
.filter((result): result is Promise<void> => result !== undefined));
|
||||
}
|
||||
|
||||
listLazyRoutes(entryRoute?: string|undefined): api.LazyRoute[] {
|
||||
|
|
Loading…
Reference in New Issue