Skip to content

Commit 9e1a05c

Browse files
author
Benjamin Lichtman
committed
Handle function assigned to binding pattern
1 parent 853afd9 commit 9e1a05c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/suggestionDiagnostics.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ namespace ts {
132132
// check that a property access expression exists in there and that it is a handler
133133
const returnStatements = getReturnStatementsWithPromiseHandlers(node);
134134
if (returnStatements.length > 0) {
135-
diags.push(createDiagnosticForNode(isVariableDeclaration(node.parent) && !node.name ? node.parent.name : node, Diagnostics.This_may_be_converted_to_an_async_function));
135+
diags.push(createDiagnosticForNode(!node.name && isVariableDeclaration(node.parent) && isIdentifier(node.parent.name) ? node.parent.name : node, Diagnostics.This_may_be_converted_to_an_async_function));
136136
}
137137
}
138138

0 commit comments

Comments
 (0)