fix(ngcc): report errors from analyze and resolve processing (#33964)

Previously, these errors were being swallowed, which made it
hard to debug problems with packages.

See https://github.com/angular/angular/issues/33685#issuecomment-557091719

PR Close #33964
This commit is contained in:
Pete Bacon Darwin
2019-11-21 16:51:41 +00:00
committed by Alex Rickabaugh
parent e53375b7b6
commit 715d02aa14
2 changed files with 41 additions and 8 deletions

View File

@ -212,9 +212,12 @@ export class DecorationAnalyzer {
analyzedFile.analyzedClasses.forEach(({declaration, matches}) => {
matches.forEach(({handler, analysis}) => {
if ((handler.resolve !== undefined) && analysis) {
const res = handler.resolve(declaration, analysis);
if (res.reexports !== undefined) {
this.addReexports(res.reexports, declaration);
const {reexports, diagnostics} = handler.resolve(declaration, analysis);
if (reexports !== undefined) {
this.addReexports(reexports, declaration);
}
if (diagnostics !== undefined) {
diagnostics.forEach(error => this.diagnosticHandler(error));
}
}
});