fix(compiler): handle undefined annotation metadata (#23349)
In certain cases seen in production, simplify() can returned undefined when simplifying decorator metadata. This has proven tricky to reproduce in an isolated test, but the fix is simple and low-risk: don't attempt to spread an undefined set of annotations in the first place. PR Close #23349
This commit is contained in:
parent
f2563ca800
commit
ca776c59dd
@ -163,8 +163,10 @@ export class StaticReflector implements CompileReflector {
|
|||||||
let ownAnnotations: any[] = [];
|
let ownAnnotations: any[] = [];
|
||||||
if (classMetadata['decorators']) {
|
if (classMetadata['decorators']) {
|
||||||
ownAnnotations = simplify(type, classMetadata['decorators']);
|
ownAnnotations = simplify(type, classMetadata['decorators']);
|
||||||
|
if (ownAnnotations) {
|
||||||
annotations.push(...ownAnnotations);
|
annotations.push(...ownAnnotations);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (parentType && !this.summaryResolver.isLibraryFile(type.filePath) &&
|
if (parentType && !this.summaryResolver.isLibraryFile(type.filePath) &&
|
||||||
this.summaryResolver.isLibraryFile(parentType.filePath)) {
|
this.summaryResolver.isLibraryFile(parentType.filePath)) {
|
||||||
const summary = this.summaryResolver.resolveSummary(parentType);
|
const summary = this.summaryResolver.resolveSummary(parentType);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user