fix(ivy): jit should handle undefined type in constructor deps (#26956)

PR Close #26956
This commit is contained in:
Kara Erickson 2018-11-05 19:00:11 -08:00
parent 7dbc103cbe
commit dc2464eaaa
1 changed files with 4 additions and 1 deletions

View File

@ -49,7 +49,10 @@ function reflectDependency(compiler: CompilerFacade, dep: any | any[]): R3Depend
}
for (let j = 0; j < dep.length; j++) {
const param = dep[j];
if (param instanceof Optional || param.__proto__.ngMetadataName === 'Optional') {
if (param === undefined) {
// param may be undefined if type of dep is not set by ngtsc
continue;
} else if (param instanceof Optional || param.__proto__.ngMetadataName === 'Optional') {
meta.optional = true;
} else if (param instanceof SkipSelf || param.__proto__.ngMetadataName === 'SkipSelf') {
meta.skipSelf = true;