fix(ivy): ngcc - support bare array constructor param decorators (#30591)

Previously we expected the constructor parameter `decorators`
property to be an array wrapped in a function. Now we also support
an array not wrapped in a function.

PR Close #30591
This commit is contained in:
Pete Bacon Darwin
2019-05-23 22:40:17 +01:00
committed by Kara Erickson
parent 869e3e8edc
commit 2dfd97d8f0
7 changed files with 155 additions and 29 deletions

View File

@ -146,7 +146,9 @@ export function validateConstructorDependencies(
// There is at least one error.
throw new FatalDiagnosticError(
ErrorCode.PARAM_MISSING_TOKEN, param.nameNode,
`No suitable injection token for parameter '${param.name || index}' of class '${clazz.name!.text}'. Found: ${param.typeNode!.getText()}`);
`No suitable injection token for parameter '${param.name || index}' of class '${clazz.name.text}'.\n` +
(param.typeNode !== null ? `Found ${param.typeNode.getText()}` :
'no type or decorator'));
}
}