Skip to content

Commit 91eb758

Browse files
committed
CR feedback
1 parent abf270a commit 91eb758

2 files changed

Lines changed: 3 additions & 11 deletions

File tree

src/compiler/checker.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ namespace ts {
160160
let getGlobalPromiseConstructorLikeType: () => ObjectType;
161161
let getGlobalThenableType: () => ObjectType;
162162

163-
let cjsRequireType: Type;
164-
165163
let tupleTypes: Map<TupleType> = {};
166164
let unionTypes: Map<UnionType> = {};
167165
let intersectionTypes: Map<IntersectionType> = {};
@@ -4203,13 +4201,9 @@ namespace ts {
42034201
* getExportedTypeFromNamespace('JSX', 'Element') returns the JSX.Element type
42044202
*/
42054203
function getExportedTypeFromNamespace(namespace: string, name: string): Type {
4206-
let typeSymbol = getExportedSymbolFromNamespace(namespace, name);
4207-
return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol);
4208-
}
4209-
4210-
function getExportedSymbolFromNamespace(namespace: string, name: string): Symbol {
42114204
let namespaceSymbol = getGlobalSymbol(namespace, SymbolFlags.Namespace, /*diagnosticMessage*/ undefined);
4212-
return namespaceSymbol && getSymbol(namespaceSymbol.exports, name, SymbolFlags.Type | SymbolFlags.Value);
4205+
let typeSymbol = namespaceSymbol && getSymbol(namespaceSymbol.exports, name, SymbolFlags.Type);
4206+
return typeSymbol && getDeclaredTypeOfSymbol(typeSymbol);
42134207
}
42144208

42154209
function getGlobalESSymbolConstructorSymbol() {
@@ -14938,8 +14932,6 @@ namespace ts {
1493814932
getGlobalPromiseConstructorLikeType = memoize(() => getGlobalType("PromiseConstructorLike"));
1493914933
getGlobalThenableType = memoize(createThenableType);
1494014934

14941-
cjsRequireType = getExportedTypeFromNamespace("CommonJS", "Require");
14942-
1494314935
// If we're in ES6 mode, load the TemplateStringsArray.
1494414936
// Otherwise, default to 'unknown' for the purposes of type checking in LS scenarios.
1494514937
if (languageVersion >= ScriptTarget.ES6) {

src/harness/harness.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ namespace Utils {
211211
return isNodeOrArray(v) ? serializeNode(v) : v;
212212
}, " ");
213213

214-
function getKindName(k: number|string): string {
214+
function getKindName(k: number | string): string {
215215
if (typeof k === "string") {
216216
return k;
217217
}

0 commit comments

Comments
 (0)