From 91eb758d5958eb0c3f19e3d2ce1a6a5923019699 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Thu, 22 Oct 2015 15:39:01 -0700 Subject: [PATCH] CR feedback --- src/compiler/checker.ts | 12 ++---------- src/harness/harness.ts | 2 +- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index ac5056bf769..c407ca0c183 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -160,8 +160,6 @@ namespace ts { let getGlobalPromiseConstructorLikeType: () => ObjectType; let getGlobalThenableType: () => ObjectType; - let cjsRequireType: Type; - let tupleTypes: Map = {}; let unionTypes: Map = {}; let intersectionTypes: Map = {}; @@ -4203,13 +4201,9 @@ namespace ts { * getExportedTypeFromNamespace('JSX', 'Element') returns the JSX.Element type */ function getExportedTypeFromNamespace(namespace: string, name: string): Type { - let typeSymbol = getExportedSymbolFromNamespace(namespace, name); - return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol); - } - - function getExportedSymbolFromNamespace(namespace: string, name: string): Symbol { let namespaceSymbol = getGlobalSymbol(namespace, SymbolFlags.Namespace, /*diagnosticMessage*/ undefined); - return namespaceSymbol && getSymbol(namespaceSymbol.exports, name, SymbolFlags.Type | SymbolFlags.Value); + let typeSymbol = namespaceSymbol && getSymbol(namespaceSymbol.exports, name, SymbolFlags.Type); + return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol); } function getGlobalESSymbolConstructorSymbol() { @@ -14938,8 +14932,6 @@ namespace ts { getGlobalPromiseConstructorLikeType = memoize(() => getGlobalType("PromiseConstructorLike")); getGlobalThenableType = memoize(createThenableType); - cjsRequireType = getExportedTypeFromNamespace("CommonJS", "Require"); - // If we're in ES6 mode, load the TemplateStringsArray. // Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios. if (languageVersion >= ScriptTarget.ES6) { diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 91897493fd9..a37b647a124 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -211,7 +211,7 @@ namespace Utils { return isNodeOrArray(v) ? serializeNode(v) : v; }, " "); - function getKindName(k: number|string): string { + function getKindName(k: number | string): string { if (typeof k === "string") { return k; }