@@ -27536,30 +27536,23 @@ namespace ts {
27536
27536
27537
27537
function checkDeprecatedSignature(signature: Signature, node: CallLikeExpression) {
27538
27538
if (signature.declaration && signature.declaration.flags & NodeFlags.Deprecated) {
27539
- const suggestionNode = getSignatureSuggestionNode (node);
27539
+ const suggestionNode = getDeprecatedSuggestionNode (node);
27540
27540
errorOrSuggestion(/*isError*/ false, suggestionNode, Diagnostics._0_is_deprecated, signatureToString(signature));
27541
27541
}
27542
27542
}
27543
27543
27544
- function getSignatureSuggestionNode(node: CallLikeExpression): Node {
27544
+ function getDeprecatedSuggestionNode(node: Node): Node {
27545
+ node = skipParentheses(node);
27545
27546
switch (node.kind) {
27546
27547
case SyntaxKind.CallExpression:
27547
27548
case SyntaxKind.Decorator:
27548
27549
case SyntaxKind.NewExpression:
27549
- return getDeprecatedSuggestionNode(node.expression);
27550
+ return getDeprecatedSuggestionNode((<Decorator | CallExpression | NewExpression> node) .expression);
27550
27551
case SyntaxKind.TaggedTemplateExpression:
27551
- return getDeprecatedSuggestionNode(node.tag);
27552
+ return getDeprecatedSuggestionNode((<TaggedTemplateExpression> node) .tag);
27552
27553
case SyntaxKind.JsxOpeningElement:
27553
27554
case SyntaxKind.JsxSelfClosingElement:
27554
- return getDeprecatedSuggestionNode(node.tagName);
27555
- default:
27556
- return Debug.assertNever(node);
27557
- }
27558
- }
27559
-
27560
- function getDeprecatedSuggestionNode(node: Node): Node {
27561
- node = skipParentheses(node);
27562
- switch (node.kind) {
27555
+ return getDeprecatedSuggestionNode((<JsxOpeningLikeElement>node).tagName);
27563
27556
case SyntaxKind.ElementAccessExpression:
27564
27557
return (<ElementAccessExpression>node).argumentExpression;
27565
27558
case SyntaxKind.PropertyAccessExpression:
0 commit comments