mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-06 15:03:14 -05:00
Remove unused flags
This commit is contained in:
@@ -2232,20 +2232,17 @@ namespace ts {
|
||||
|
||||
function typeFormatFlagsToNodeBuilderFlags(flags: TypeFormatFlags): NodeBuilderFlags {
|
||||
let result = NodeBuilderFlags.None;
|
||||
if (flags & TypeFormatFlags.WriteArrayAsGenericType) {
|
||||
result |= NodeBuilderFlags.WriteArrayAsGenericType;
|
||||
}
|
||||
if (flags & TypeFormatFlags.UseTypeOfFunction) {
|
||||
result |= NodeBuilderFlags.UseTypeOfFunction;
|
||||
if (flags === TypeFormatFlags.None) {
|
||||
return result;
|
||||
}
|
||||
if (flags & TypeFormatFlags.NoTruncation) {
|
||||
result |= NodeBuilderFlags.NoTruncation;
|
||||
}
|
||||
if (flags & TypeFormatFlags.WriteArrowStyleSignature) {
|
||||
result |= NodeBuilderFlags.WriteArrowStyleSignature;
|
||||
if (flags & TypeFormatFlags.UseFullyQualifiedType) {
|
||||
result |= NodeBuilderFlags.UseFullyQualifiedType;
|
||||
}
|
||||
if (flags & TypeFormatFlags.WriteOwnNameForAnyLike) {
|
||||
result |= NodeBuilderFlags.WriteOwnNameForAnyLike;
|
||||
if (flags & TypeFormatFlags.SuppressAnyReturnType) {
|
||||
result |= NodeBuilderFlags.SuppressAnyReturnType;
|
||||
}
|
||||
if (flags & TypeFormatFlags.WriteArrayAsGenericType) {
|
||||
result |= NodeBuilderFlags.WriteArrayAsGenericType;
|
||||
@@ -2253,18 +2250,6 @@ namespace ts {
|
||||
if (flags & TypeFormatFlags.WriteTypeArgumentsOfSignature) {
|
||||
result |= NodeBuilderFlags.WriteTypeArgumentsOfSignature;
|
||||
}
|
||||
if (flags & TypeFormatFlags.UseFullyQualifiedType) {
|
||||
result |= NodeBuilderFlags.UseFullyQualifiedType;
|
||||
}
|
||||
if (flags & TypeFormatFlags.UseTypeAliasValue) {
|
||||
result |= NodeBuilderFlags.UseTypeAliasValue;
|
||||
}
|
||||
if (flags & TypeFormatFlags.SuppressAnyReturnType) {
|
||||
result |= NodeBuilderFlags.SuppressAnyReturnType;
|
||||
}
|
||||
if (flags & TypeFormatFlags.AddUndefined) {
|
||||
result |= NodeBuilderFlags.AddUndefined;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -2893,7 +2878,6 @@ namespace ts {
|
||||
|
||||
function createEntityNameFromSymbolChain(chain: Symbol[], index: number): EntityName {
|
||||
Debug.assert(chain && 0 <= index && index < chain.length);
|
||||
// const parentIndex = index - 1;
|
||||
const symbol = chain[index];
|
||||
let typeParameterNodes: TypeNode[] | undefined;
|
||||
if (index > 0) {
|
||||
|
||||
@@ -2497,7 +2497,7 @@ namespace ts {
|
||||
|
||||
/** Note that the resulting nodes cannot be checked. */
|
||||
|
||||
typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags, inTypeAlias?: boolean): TypeNode;
|
||||
typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeNode;
|
||||
/** Note that the resulting nodes cannot be checked. */
|
||||
signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): SignatureDeclaration;
|
||||
/** Note that the resulting nodes cannot be checked. */
|
||||
@@ -2562,22 +2562,10 @@ namespace ts {
|
||||
None = 0,
|
||||
// Options
|
||||
NoTruncation = 1 << 0, // Don't truncate result
|
||||
// TODO: part of emit.
|
||||
WriteArrayAsGenericType = 1 << 1, // Write Array<T> instead T[]
|
||||
// TODO: part of emit.
|
||||
UseTypeOfFunction = 1 << 2, // Write typeof instead of function type literal
|
||||
// TODO: part of emit.
|
||||
WriteArrowStyleSignature = 1 << 3, // Write arrow style signature
|
||||
// TODO: turn it into a failing type reference?
|
||||
WriteOwnNameForAnyLike = 1 << 4, // Write symbol's own name instead of 'any' for any like types (eg. unknown, __resolving__ etc)
|
||||
// TODO
|
||||
WriteTypeArgumentsOfSignature = 1 << 5, // Write the type arguments instead of type parameters of the signature
|
||||
UseFullyQualifiedType = 1 << 6, // Write out the fully qualified type name (eg. Module.Type, instead of Type)
|
||||
// TODO
|
||||
UseTypeAliasValue = 1 << 7, // Serialize the type instead of using type-alias. This is needed when we emit declaration file.
|
||||
SuppressAnyReturnType = 1 << 8, // If the return type is any-like, don't offer a return type.
|
||||
// TODO
|
||||
AddUndefined = 1 << 9, // Add undefined to types of initialized, non-optional parameters
|
||||
|
||||
// Error handling
|
||||
allowThisInObjectLiteral = 1 << 10,
|
||||
|
||||
@@ -359,7 +359,6 @@ namespace ts {
|
||||
|
||||
case SyntaxKind.PropertySignature:
|
||||
return updatePropertySignature((<PropertySignature>node),
|
||||
// TODO: tokenVisitor or visitor for a nodearray of tokens?
|
||||
nodesVisitor((<PropertySignature>node).modifiers, visitor, isToken),
|
||||
visitNode((<PropertySignature>node).name, visitor, isPropertyName),
|
||||
visitNode((<PropertySignature>node).questionToken, tokenVisitor, isToken),
|
||||
|
||||
Reference in New Issue
Block a user