return more Debug.fails instead of undefined.

This commit is contained in:
Nathan Shively-Sanders 2017-10-13 09:45:41 -07:00
parent c83daa6481
commit 84e3507151

View file

@ -56,8 +56,7 @@ namespace ts.refactor.annotateWithTypeFromJSDoc {
function getEditsForAnnotation(context: RefactorContext, action: string): RefactorEditInfo | undefined {
if (actionName !== action) {
Debug.fail(`actionName !== action: ${actionName} !== ${action}`);
return undefined;
return Debug.fail(`actionName !== action: ${actionName} !== ${action}`);
}
const sourceFile = context.file;
@ -81,8 +80,7 @@ namespace ts.refactor.annotateWithTypeFromJSDoc {
function getEditsForFunctionAnnotation(context: RefactorContext, action: string): RefactorEditInfo | undefined {
if (actionName !== action) {
Debug.fail(`actionName !== action: ${actionName} !== ${action}`);
return undefined;
return Debug.fail(`actionName !== action: ${actionName} !== ${action}`);
}
const sourceFile = context.file;
@ -141,8 +139,7 @@ namespace ts.refactor.annotateWithTypeFromJSDoc {
case SyntaxKind.PropertyDeclaration:
return createProperty(decl.decorators, decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer);
default:
Debug.fail(`Unexpected SyntaxKind: ${decl.kind}`);
return undefined;
return Debug.fail(`Unexpected SyntaxKind: ${decl.kind}`);
}
}