Skip to content

Commit af0189c

Browse files
committed
fix jsdoc cache
1 parent a81c55f commit af0189c

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

src/compiler/binder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ namespace ts {
414414
Debug.assert(!hasDynamicName(node));
415415

416416
const isDefaultExport = hasSyntacticModifier(node, ModifierFlags.Default) || isExportSpecifier(node) && node.name.escapedText === "default";
417-
const isDeprecated = !!getJSDocDeprecatedTag(node);
417+
const isDeprecated = !!getJSDocDeprecatedTag(node, /* noCache */ true);
418418

419419
// The exported symbol for an export default function/class node is always named "default"
420420
const name = isDefaultExport && parent ? InternalSymbolName.Default : getDeclarationName(node);

src/compiler/checker.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -12922,7 +12922,7 @@ namespace ts {
1292212922
if (prop) {
1292312923
if (accessNode && prop?.isDeprecated) {
1292412924
const deprecatedNode = accessExpression?.argumentExpression ?? (isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode);
12925-
errorOrSuggestion(/* isError */false, deprecatedNode, Diagnostics._0_is_deprecated, propName as string);
12925+
errorOrSuggestion(/* isError */ false, deprecatedNode, Diagnostics._0_is_deprecated, propName as string);
1292612926
}
1292712927
if (accessExpression) {
1292812928
markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === SyntaxKind.ThisKeyword);
@@ -21400,8 +21400,8 @@ namespace ts {
2140021400
let declaration: Declaration | undefined = localOrExportSymbol.valueDeclaration;
2140121401

2140221402
if (symbol?.isDeprecated) {
21403-
errorOrSuggestion(/* isError */false, node, Diagnostics._0_is_deprecated, node.escapedText as string);
21404-
}
21403+
errorOrSuggestion(/* isError */ false, node, Diagnostics._0_is_deprecated, node.escapedText as string);
21404+
}
2140521405
if (localOrExportSymbol.flags & SymbolFlags.Class) {
2140621406
// Due to the emit for class decorators, any reference to the class from inside of the class body
2140721407
// must instead be rewritten to point to a temporary variable to avoid issues with the double-bind
@@ -24366,7 +24366,7 @@ namespace ts {
2436624366
}
2436724367
else {
2436824368
if (prop?.isDeprecated) {
24369-
errorOrSuggestion(/* isError */false, right, Diagnostics._0_is_deprecated, right.escapedText as string);
24369+
errorOrSuggestion(/* isError */ false, right, Diagnostics._0_is_deprecated, right.escapedText as string);
2437024370
}
2437124371

2437224372
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
@@ -30099,7 +30099,7 @@ namespace ts {
3009930099
}
3010030100
const symbol = getNodeLinks(node).resolvedSymbol!;
3010130101
if (symbol?.isDeprecated) {
30102-
errorOrSuggestion(/* isError */false, node, Diagnostics._0_is_deprecated, symbol.escapedName as string);
30102+
errorOrSuggestion(/* isError */ false, node, Diagnostics._0_is_deprecated, symbol.escapedName as string);
3010330103
}
3010430104
if (type.flags & TypeFlags.Enum && symbol.flags & SymbolFlags.EnumMember) {
3010530105
error(node, Diagnostics.Enum_type_0_has_members_with_initializers_that_are_not_literals, typeToString(type));

src/compiler/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4111,7 +4111,7 @@ namespace ts {
41114111
/* @internal */ isReferenced?: SymbolFlags; // True if the symbol is referenced elsewhere. Keeps track of the meaning of a reference in case a symbol is both a type parameter and parameter.
41124112
/* @internal */ isReplaceableByMethod?: boolean; // Can this Javascript class property be replaced by a method symbol?
41134113
/* @internal */ isAssigned?: boolean; // True if the symbol is a parameter with assignments
4114-
/* @internal */ assignmentDeclarationMembers?: Map<Declaration>; // detected late-bound assignment declarations associated with the symbol
4114+
/* @internal */ assignmentDeclarationMembers?: Map<Declaration>; // detected late-bound assignment declarations associated with the symbol
41154115
/* @internal */ isDeprecated?: boolean;
41164116
}
41174117

src/compiler/utilitiesPublic.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,8 @@ namespace ts {
760760
}
761761

762762
/** Gets the JSDoc deprecated tag for the node if present */
763-
export function getJSDocDeprecatedTag(node: Node): JSDocDeprecatedTag | undefined {
764-
return getFirstJSDocTag(node, isJSDocDeprecatedTag);
763+
export function getJSDocDeprecatedTag(node: Node, noCache?: boolean): JSDocDeprecatedTag | undefined {
764+
return getFirstJSDocTag(node, isJSDocDeprecatedTag, noCache);
765765
}
766766

767767
/** Gets the JSDoc type tag for the node if present and valid */

0 commit comments

Comments
 (0)