fix(core): properly handle function without prototype in reflector (#22284)

closes #19978

PR Close #22284
This commit is contained in:
Trotyl
2018-02-18 17:22:23 +08:00
committed by Victor Berchet
parent b42921bbd2
commit a7ebf5aadd
2 changed files with 8 additions and 1 deletions

View File

@ -252,7 +252,7 @@ function convertTsickleDecoratorIntoMetadata(decoratorInvocations: any[]): any[]
}
function getParentCtor(ctor: Function): Type<any> {
const parentProto = Object.getPrototypeOf(ctor.prototype);
const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null;
const parentCtor = parentProto ? parentProto.constructor : null;
// Note: We always use `Object` as the null value
// to simplify checking later on.