mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 02:30:15 -06:00
Add debug format helpers for more enums (#49732)
This commit is contained in:
parent
9872184483
commit
94a65769d4
@ -61,7 +61,7 @@ namespace ts {
|
||||
GeneratorYield,
|
||||
}
|
||||
|
||||
const enum TypeFacts {
|
||||
export const enum TypeFacts {
|
||||
None = 0,
|
||||
TypeofEQString = 1 << 0, // typeof x === "string"
|
||||
TypeofEQNumber = 1 << 1, // typeof x === "number"
|
||||
@ -169,7 +169,7 @@ namespace ts {
|
||||
WriteType,
|
||||
}
|
||||
|
||||
const enum CheckMode {
|
||||
export const enum CheckMode {
|
||||
Normal = 0, // Normal type checking
|
||||
Contextual = 1 << 0, // Explicitly assigned contextual type, therefore not cacheable
|
||||
Inferential = 1 << 1, // Inferential typing
|
||||
@ -182,7 +182,7 @@ namespace ts {
|
||||
// we need to preserve generic types instead of substituting them for constraints
|
||||
}
|
||||
|
||||
const enum SignatureCheckMode {
|
||||
export const enum SignatureCheckMode {
|
||||
BivariantCallback = 1 << 0,
|
||||
StrictCallback = 1 << 1,
|
||||
IgnoreReturnTypes = 1 << 2,
|
||||
|
||||
@ -394,6 +394,22 @@ namespace ts {
|
||||
return formatEnum(flags, (ts as any).FlowFlags, /*isFlags*/ true);
|
||||
}
|
||||
|
||||
export function formatRelationComparisonResult(result: RelationComparisonResult | undefined): string {
|
||||
return formatEnum(result, (ts as any).RelationComparisonResult, /*isFlags*/ true);
|
||||
}
|
||||
|
||||
export function formatCheckMode(mode: CheckMode | undefined): string {
|
||||
return formatEnum(mode, (ts as any).CheckMode, /*isFlags*/ true);
|
||||
}
|
||||
|
||||
export function formatSignatureCheckMode(mode: SignatureCheckMode | undefined): string {
|
||||
return formatEnum(mode, (ts as any).SignatureCheckMode, /*isFlags*/ true);
|
||||
}
|
||||
|
||||
export function formatTypeFacts(facts: TypeFacts | undefined): string {
|
||||
return formatEnum(facts, (ts as any).TypeFacts, /*isFlags*/ true);
|
||||
}
|
||||
|
||||
let isDebugInfoEnabled = false;
|
||||
|
||||
interface ExtendedDebugModule {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user