mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
CR feedback
This commit is contained in:
+2
-10
@@ -160,8 +160,6 @@ namespace ts {
|
||||
let getGlobalPromiseConstructorLikeType: () => ObjectType;
|
||||
let getGlobalThenableType: () => ObjectType;
|
||||
|
||||
let cjsRequireType: Type;
|
||||
|
||||
let tupleTypes: Map<TupleType> = {};
|
||||
let unionTypes: Map<UnionType> = {};
|
||||
let intersectionTypes: Map<IntersectionType> = {};
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user