mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-16 23:19:30 -05:00
Debug.failBadSyntaxKind should always be defined and return 'never' (#22091)
This commit is contained in:
@@ -1546,11 +1546,11 @@ namespace ts {
|
||||
export namespace Debug {
|
||||
let isDebugInfoEnabled = false;
|
||||
|
||||
export const failBadSyntaxKind = shouldAssert(AssertionLevel.Normal)
|
||||
? (node: Node, message?: string): never => fail(
|
||||
export function failBadSyntaxKind(node: Node, message?: string): never {
|
||||
return fail(
|
||||
`${message || "Unexpected node."}\r\nNode ${formatSyntaxKind(node.kind)} was unexpected.`,
|
||||
failBadSyntaxKind)
|
||||
: noop as () => never; // TODO: GH#22091
|
||||
failBadSyntaxKind);
|
||||
}
|
||||
|
||||
export const assertEachNode = shouldAssert(AssertionLevel.Normal)
|
||||
? (nodes: Node[], test: (node: Node) => boolean, message?: string): void => assert(
|
||||
|
||||
Reference in New Issue
Block a user