Skip to content

Commit

Permalink
Debug.failBadSyntaxKind should always be defined and return 'never' (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy authored Mar 27, 2018
1 parent 21cd68d commit 0a2c160
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/compiler/visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 0a2c160

Please sign in to comment.