MCPcopy Create free account
hub / github.com/microsoft/typescript-go / IsDeprecatedDeclarationWithCachedFlags

Function IsDeprecatedDeclarationWithCachedFlags

internal/ast/utilities.go:1223–1235  ·  view source on GitHub ↗

IsDeprecatedDeclarationWithCachedFlags is the core logic for IsDeprecatedDeclaration, parameterized on pre-computed combined flags so the checker can supply cached flags.

(declaration *Node, combinedFlags NodeFlags)

Source from the content-addressed store, hash-verified

1221// IsDeprecatedDeclarationWithCachedFlags is the core logic for IsDeprecatedDeclaration,
1222// parameterized on pre-computed combined flags so the checker can supply cached flags.
1223func IsDeprecatedDeclarationWithCachedFlags(declaration *Node, combinedFlags NodeFlags) bool {
1224 if combinedFlags&NodeFlagsPossiblyContainsDeprecatedTag == 0 {
1225 return false
1226 }
1227 // Walk up to find the node that directly has the flag, since JSDoc is
1228 // attached to that node (e.g. VariableStatement, not VariableDeclaration).
1229 for n := declaration; n != nil; n = n.Parent {
1230 if n.Flags&NodeFlagsPossiblyContainsDeprecatedTag != 0 {
1231 return GetJSDocDeprecatedTag(n) != nil
1232 }
1233 }
1234 return false
1235}
1236
1237// Gets whether a bound `VariableDeclaration` or `VariableDeclarationList` is part of a `const` declaration.
1238func IsVarConst(node *Node) bool {

Callers 2

IsDeprecatedDeclarationFunction · 0.85

Calls 1

GetJSDocDeprecatedTagFunction · 0.85

Tested by

no test coverage detected