refactor: early compatibility with TypeScript 3.5 (#31174)

This commit fixes a couple of issues with TS 3.5 compatibility in order to
unblock migration of g3. Mostly 'any's are added, and there are no behavior
changes.

PR Close #31174
This commit is contained in:
Alex Rickabaugh
2019-06-20 13:15:57 -07:00
committed by Kara Erickson
parent 34eaafdf40
commit fad03c3c14
3 changed files with 12 additions and 8 deletions

View File

@ -907,7 +907,7 @@ export class CompileMetadataResolver {
let isOptional = false;
let token: any = null;
if (Array.isArray(param)) {
param.forEach((paramEntry) => {
param.forEach((paramEntry: any) => {
if (createHost.isTypeOf(paramEntry)) {
isHost = true;
} else if (createSelf.isTypeOf(paramEntry)) {
@ -918,11 +918,12 @@ export class CompileMetadataResolver {
isOptional = true;
} else if (createAttribute.isTypeOf(paramEntry)) {
isAttribute = true;
token = paramEntry.attributeName;
token = (paramEntry as any).attributeName;
} else if (createInject.isTypeOf(paramEntry)) {
token = paramEntry.token;
token = (paramEntry as any).token;
} else if (
createInjectionToken.isTypeOf(paramEntry) || paramEntry instanceof StaticSymbol) {
createInjectionToken.isTypeOf(paramEntry) ||
(paramEntry as any) instanceof StaticSymbol) {
token = paramEntry;
} else if (isValidType(paramEntry) && token == null) {
token = paramEntry;