IsDeprecatedDeclarationWithCachedFlags is the core logic for IsDeprecatedDeclaration, parameterized on pre-computed combined flags so the checker can supply cached flags.
(declaration *Node, combinedFlags NodeFlags)
| 1221 | // IsDeprecatedDeclarationWithCachedFlags is the core logic for IsDeprecatedDeclaration, |
| 1222 | // parameterized on pre-computed combined flags so the checker can supply cached flags. |
| 1223 | func 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. |
| 1238 | func IsVarConst(node *Node) bool { |
no test coverage detected