fix(tsickle): support ctorParams in function closure (#12876)
See https://github.com/angular/tsickle/issues/261 for context.
This commit is contained in:

committed by
Victor Berchet

parent
46d150266b
commit
75277cd94b
@ -56,8 +56,12 @@ export class ReflectionCapabilities implements PlatformReflectionCapabilities {
|
||||
}
|
||||
|
||||
// API of tsickle for lowering decorators to properties on the class.
|
||||
if ((<any>type).ctorParameters) {
|
||||
const ctorParameters = (<any>type).ctorParameters;
|
||||
const tsickleCtorParams = (<any>type).ctorParameters;
|
||||
if (tsickleCtorParams) {
|
||||
// Newer tsickle uses a function closure
|
||||
// Retain the non-function case for compatibility with older tsickle
|
||||
const ctorParameters =
|
||||
typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams;
|
||||
const paramTypes = ctorParameters.map((ctorParam: any) => ctorParam && ctorParam.type);
|
||||
const paramAnnotations = ctorParameters.map(
|
||||
(ctorParam: any) =>
|
||||
|
Reference in New Issue
Block a user