Skip to content

Commit 3640abd

Browse files
author
Arthur Ozga
committed
Remove unused flags
1 parent 7d48dee commit 3640abd

File tree

3 files changed

+7
-36
lines changed

3 files changed

+7
-36
lines changed

src/compiler/checker.ts

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2232,39 +2232,24 @@ namespace ts {
22322232

22332233
function typeFormatFlagsToNodeBuilderFlags(flags: TypeFormatFlags): NodeBuilderFlags {
22342234
let result = NodeBuilderFlags.None;
2235-
if (flags & TypeFormatFlags.WriteArrayAsGenericType) {
2236-
result |= NodeBuilderFlags.WriteArrayAsGenericType;
2237-
}
2238-
if (flags & TypeFormatFlags.UseTypeOfFunction) {
2239-
result |= NodeBuilderFlags.UseTypeOfFunction;
2235+
if (flags === TypeFormatFlags.None) {
2236+
return result;
22402237
}
22412238
if (flags & TypeFormatFlags.NoTruncation) {
22422239
result |= NodeBuilderFlags.NoTruncation;
22432240
}
2244-
if (flags & TypeFormatFlags.WriteArrowStyleSignature) {
2245-
result |= NodeBuilderFlags.WriteArrowStyleSignature;
2241+
if (flags & TypeFormatFlags.UseFullyQualifiedType) {
2242+
result |= NodeBuilderFlags.UseFullyQualifiedType;
22462243
}
2247-
if (flags & TypeFormatFlags.WriteOwnNameForAnyLike) {
2248-
result |= NodeBuilderFlags.WriteOwnNameForAnyLike;
2244+
if (flags & TypeFormatFlags.SuppressAnyReturnType) {
2245+
result |= NodeBuilderFlags.SuppressAnyReturnType;
22492246
}
22502247
if (flags & TypeFormatFlags.WriteArrayAsGenericType) {
22512248
result |= NodeBuilderFlags.WriteArrayAsGenericType;
22522249
}
22532250
if (flags & TypeFormatFlags.WriteTypeArgumentsOfSignature) {
22542251
result |= NodeBuilderFlags.WriteTypeArgumentsOfSignature;
22552252
}
2256-
if (flags & TypeFormatFlags.UseFullyQualifiedType) {
2257-
result |= NodeBuilderFlags.UseFullyQualifiedType;
2258-
}
2259-
if (flags & TypeFormatFlags.UseTypeAliasValue) {
2260-
result |= NodeBuilderFlags.UseTypeAliasValue;
2261-
}
2262-
if (flags & TypeFormatFlags.SuppressAnyReturnType) {
2263-
result |= NodeBuilderFlags.SuppressAnyReturnType;
2264-
}
2265-
if (flags & TypeFormatFlags.AddUndefined) {
2266-
result |= NodeBuilderFlags.AddUndefined;
2267-
}
22682253

22692254
return result;
22702255
}
@@ -2893,7 +2878,6 @@ namespace ts {
28932878

28942879
function createEntityNameFromSymbolChain(chain: Symbol[], index: number): EntityName {
28952880
Debug.assert(chain && 0 <= index && index < chain.length);
2896-
// const parentIndex = index - 1;
28972881
const symbol = chain[index];
28982882
let typeParameterNodes: TypeNode[] | undefined;
28992883
if (index > 0) {

src/compiler/types.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2497,7 +2497,7 @@ namespace ts {
24972497

24982498
/** Note that the resulting nodes cannot be checked. */
24992499

2500-
typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags, inTypeAlias?: boolean): TypeNode;
2500+
typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeNode;
25012501
/** Note that the resulting nodes cannot be checked. */
25022502
signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration;
25032503
/** Note that the resulting nodes cannot be checked. */
@@ -2562,22 +2562,10 @@ namespace ts {
25622562
None = 0,
25632563
// Options
25642564
NoTruncation = 1 << 0, // Don't truncate result
2565-
// TODO: part of emit.
25662565
WriteArrayAsGenericType = 1 << 1, // Write Array<T> instead T[]
2567-
// TODO: part of emit.
2568-
UseTypeOfFunction = 1 << 2, // Write typeof instead of function type literal
2569-
// TODO: part of emit.
2570-
WriteArrowStyleSignature = 1 << 3, // Write arrow style signature
2571-
// TODO: turn it into a failing type reference?
2572-
WriteOwnNameForAnyLike = 1 << 4, // Write symbol's own name instead of 'any' for any like types (eg. unknown, __resolving__ etc)
2573-
// TODO
25742566
WriteTypeArgumentsOfSignature = 1 << 5, // Write the type arguments instead of type parameters of the signature
25752567
UseFullyQualifiedType = 1 << 6, // Write out the fully qualified type name (eg. Module.Type, instead of Type)
2576-
// TODO
2577-
UseTypeAliasValue = 1 << 7, // Serialize the type instead of using type-alias. This is needed when we emit declaration file.
25782568
SuppressAnyReturnType = 1 << 8, // If the return type is any-like, don't offer a return type.
2579-
// TODO
2580-
AddUndefined = 1 << 9, // Add undefined to types of initialized, non-optional parameters
25812569

25822570
// Error handling
25832571
allowThisInObjectLiteral = 1 << 10,

src/compiler/visitor.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ namespace ts {
359359

360360
case SyntaxKind.PropertySignature:
361361
return updatePropertySignature((<PropertySignature>node),
362-
// TODO: tokenVisitor or visitor for a nodearray of tokens?
363362
nodesVisitor((<PropertySignature>node).modifiers, visitor, isToken),
364363
visitNode((<PropertySignature>node).name, visitor, isPropertyName),
365364
visitNode((<PropertySignature>node).questionToken, tokenVisitor, isToken),

0 commit comments

Comments
 (0)