Skip to content

Commit 57a6dbd

Browse files
author
Benjamin Lichtman
committed
Add clarifying comments
1 parent 95d5788 commit 57a6dbd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/services/codefixes/convertToAsyncFunction.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,10 @@ namespace ts.codefix {
393393
const shouldReturn = transformer.setOfExpressionsToReturn.get(getNodeId(parent).toString());
394394
switch (func.kind) {
395395
case SyntaxKind.NullKeyword:
396-
// do not produce a transformed statement for a null or undefined argument
396+
// do not produce a transformed statement for a null argument
397397
break;
398398
case SyntaxKind.Identifier:
399+
// identifier includes undefined
399400
if (!hasArgName) break;
400401

401402
const synthCall = createCall(getSynthesizedDeepClone(func) as Identifier, /*typeArguments*/ undefined, [argName.identifier]);

src/services/suggestionDiagnostics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ namespace ts {
196196
function isFixablePromiseArgument(arg: Expression): boolean {
197197
switch (arg.kind) {
198198
case SyntaxKind.NullKeyword:
199-
case SyntaxKind.Identifier:
199+
case SyntaxKind.Identifier: // identifier includes undefined
200200
case SyntaxKind.FunctionDeclaration:
201201
case SyntaxKind.FunctionExpression:
202202
case SyntaxKind.ArrowFunction:

0 commit comments

Comments
 (0)