Skip to content

Commit 84e3507

Browse files
committed
return more Debug.fails instead of undefined.
1 parent c83daa6 commit 84e3507

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/services/refactors/annotateWithTypeFromJSDoc.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@ namespace ts.refactor.annotateWithTypeFromJSDoc {
5656

5757
function getEditsForAnnotation(context: RefactorContext, action: string): RefactorEditInfo | undefined {
5858
if (actionName !== action) {
59-
Debug.fail(`actionName !== action: ${actionName} !== ${action}`);
60-
return undefined;
59+
return Debug.fail(`actionName !== action: ${actionName} !== ${action}`);
6160
}
6261

6362
const sourceFile = context.file;
@@ -81,8 +80,7 @@ namespace ts.refactor.annotateWithTypeFromJSDoc {
8180

8281
function getEditsForFunctionAnnotation(context: RefactorContext, action: string): RefactorEditInfo | undefined {
8382
if (actionName !== action) {
84-
Debug.fail(`actionName !== action: ${actionName} !== ${action}`);
85-
return undefined;
83+
return Debug.fail(`actionName !== action: ${actionName} !== ${action}`);
8684
}
8785

8886
const sourceFile = context.file;
@@ -141,8 +139,7 @@ namespace ts.refactor.annotateWithTypeFromJSDoc {
141139
case SyntaxKind.PropertyDeclaration:
142140
return createProperty(decl.decorators, decl.modifiers, decl.name, decl.questionToken, jsdocType, decl.initializer);
143141
default:
144-
Debug.fail(`Unexpected SyntaxKind: ${decl.kind}`);
145-
return undefined;
142+
return Debug.fail(`Unexpected SyntaxKind: ${decl.kind}`);
146143
}
147144
}
148145

0 commit comments

Comments
 (0)