From c2cd4f66e715e89e9c7959064f0a4465d59b0443 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders Date: Mon, 13 Feb 2017 13:21:12 -0800 Subject: [PATCH] Address PR comments and fix lint --- src/compiler/checker.ts | 3 +-- src/compiler/declarationEmitter.ts | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ab4f961e3a0..3517f407f87 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -3167,8 +3167,7 @@ namespace ts { /** Return the inferred type for a binding element */ function getTypeForBindingElement(declaration: BindingElement): Type { const pattern = declaration.parent; - let parentType = getTypeForBindingElementParent(pattern.parent); - + const parentType = getTypeForBindingElementParent(pattern.parent); // If parent has the unknown (error) type, then so does this binding element if (parentType === unknownType) { return unknownType; diff --git a/src/compiler/declarationEmitter.ts b/src/compiler/declarationEmitter.ts index 95a56b12dd3..de8be5a27e8 100644 --- a/src/compiler/declarationEmitter.ts +++ b/src/compiler/declarationEmitter.ts @@ -333,10 +333,8 @@ namespace ts { } else { errorNameNode = declaration.name; - let format = TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue; - if (shouldUseResolverType) { - format |= TypeFormatFlags.AddUndefined; - } + const format = TypeFormatFlags.UseTypeOfFunction | TypeFormatFlags.UseTypeAliasValue | + (shouldUseResolverType ? TypeFormatFlags.AddUndefined : 0); resolver.writeTypeOfDeclaration(declaration, enclosingDeclaration, format, writer); errorNameNode = undefined; }