mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 20:14:01 -06:00
Add @deprecated to tree walk (#43473)
So various things don't crash. Fixes #43472
This commit is contained in:
parent
8f8a579eee
commit
c6a2e45768
@ -551,6 +551,7 @@ namespace ts {
|
||||
case SyntaxKind.JSDocPrivateTag:
|
||||
case SyntaxKind.JSDocProtectedTag:
|
||||
case SyntaxKind.JSDocReadonlyTag:
|
||||
case SyntaxKind.JSDocDeprecatedTag:
|
||||
return visitNode(cbNode, (node as JSDocTag).tagName)
|
||||
|| (typeof (node as JSDoc).comment === "string" ? undefined : visitNodes(cbNode, cbNodes, (node as JSDoc).comment as NodeArray<JSDocText | JSDocLink> | undefined));
|
||||
case SyntaxKind.PartiallyEmittedExpression:
|
||||
|
||||
111
tests/baselines/reference/quickInfoInheritedLinkTag.baseline
Normal file
111
tests/baselines/reference/quickInfoInheritedLinkTag.baseline
Normal file
@ -0,0 +1,111 @@
|
||||
[
|
||||
{
|
||||
"marker": {
|
||||
"fileName": "/tests/cases/fourslash/quickInfoInheritedLinkTag.ts",
|
||||
"position": 258,
|
||||
"name": ""
|
||||
},
|
||||
"quickInfo": {
|
||||
"kind": "method",
|
||||
"kindModifiers": "deprecated",
|
||||
"textSpan": {
|
||||
"start": 257,
|
||||
"length": 1
|
||||
},
|
||||
"displayParts": [
|
||||
{
|
||||
"text": "(",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": "method",
|
||||
"kind": "text"
|
||||
},
|
||||
{
|
||||
"text": ")",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "C",
|
||||
"kind": "className"
|
||||
},
|
||||
{
|
||||
"text": ".",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": "m",
|
||||
"kind": "methodName"
|
||||
},
|
||||
{
|
||||
"text": "(",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": ")",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": ":",
|
||||
"kind": "punctuation"
|
||||
},
|
||||
{
|
||||
"text": " ",
|
||||
"kind": "space"
|
||||
},
|
||||
{
|
||||
"text": "void",
|
||||
"kind": "keyword"
|
||||
}
|
||||
],
|
||||
"documentation": [],
|
||||
"tags": [
|
||||
{
|
||||
"name": "deprecated",
|
||||
"text": [
|
||||
{
|
||||
"text": "Use ",
|
||||
"kind": "text"
|
||||
},
|
||||
{
|
||||
"text": "{@link ",
|
||||
"kind": "link"
|
||||
},
|
||||
{
|
||||
"text": "PerspectiveCamera#setFocalLength .setFocalLength()",
|
||||
"kind": "linkText"
|
||||
},
|
||||
{
|
||||
"text": "}",
|
||||
"kind": "link"
|
||||
},
|
||||
{
|
||||
"text": " and ",
|
||||
"kind": "text"
|
||||
},
|
||||
{
|
||||
"text": "{@link ",
|
||||
"kind": "link"
|
||||
},
|
||||
{
|
||||
"text": "PerspectiveCamera#filmGauge .filmGauge",
|
||||
"kind": "linkText"
|
||||
},
|
||||
{
|
||||
"text": "}",
|
||||
"kind": "link"
|
||||
},
|
||||
{
|
||||
"text": " instead.",
|
||||
"kind": "text"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
15
tests/cases/fourslash/quickInfoInheritedLinkTag.ts
Normal file
15
tests/cases/fourslash/quickInfoInheritedLinkTag.ts
Normal file
@ -0,0 +1,15 @@
|
||||
///<reference path="fourslash.ts" />
|
||||
|
||||
//// export class C {
|
||||
//// /**
|
||||
//// * @deprecated Use {@link PerspectiveCamera#setFocalLength .setFocalLength()} and {@link PerspectiveCamera#filmGauge .filmGauge} instead.
|
||||
//// */
|
||||
//// m() { }
|
||||
//// }
|
||||
//// export class D extends C {
|
||||
//// m() { } // crashes here
|
||||
//// }
|
||||
//// new C().m/**/ // and here (with a different thing trying to access undefined)
|
||||
|
||||
verify.noErrors()
|
||||
verify.baselineQuickInfo();
|
||||
Loading…
x
Reference in New Issue
Block a user