Add clarifying comments

This commit is contained in:
Benjamin Lichtman 2018-09-14 08:50:18 -07:00
parent 95d57885c5
commit 57a6dbd6fa
2 changed files with 3 additions and 2 deletions

View File

@ -393,9 +393,10 @@ namespace ts.codefix {
const shouldReturn = transformer.setOfExpressionsToReturn.get(getNodeId(parent).toString());
switch (func.kind) {
case SyntaxKind.NullKeyword:
// do not produce a transformed statement for a null or undefined argument
// do not produce a transformed statement for a null argument
break;
case SyntaxKind.Identifier:
// identifier includes undefined
if (!hasArgName) break;
const synthCall = createCall(getSynthesizedDeepClone(func) as Identifier, /*typeArguments*/ undefined, [argName.identifier]);

View File

@ -196,7 +196,7 @@ namespace ts {
function isFixablePromiseArgument(arg: Expression): boolean {
switch (arg.kind) {
case SyntaxKind.NullKeyword:
case SyntaxKind.Identifier:
case SyntaxKind.Identifier: // identifier includes undefined
case SyntaxKind.FunctionDeclaration:
case SyntaxKind.FunctionExpression:
case SyntaxKind.ArrowFunction: