mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
JS: Add jsdoc type lookup to definitions.ql
This commit is contained in:
@@ -147,7 +147,15 @@ predicate typedInvokeLookup(ASTNode ref, ASTNode decl, string kind) {
|
||||
)
|
||||
}
|
||||
|
||||
from ASTNode ref, ASTNode decl, string kind
|
||||
/**
|
||||
* Holds if `ref` is a JSDoc type annotation referring to a class defined at `decl`.
|
||||
*/
|
||||
predicate jsdocTypeLookup(JSDocNamedTypeExpr ref, ASTNode decl, string kind) {
|
||||
decl = ref.getClass().getAstNode() and
|
||||
kind = "T"
|
||||
}
|
||||
|
||||
from Locatable ref, ASTNode decl, string kind
|
||||
where
|
||||
variableDefLookup(ref, decl, kind)
|
||||
or
|
||||
@@ -161,4 +169,6 @@ where
|
||||
typeLookup(ref, decl, kind)
|
||||
or
|
||||
typedInvokeLookup(ref, decl, kind)
|
||||
or
|
||||
jsdocTypeLookup(ref, decl, kind)
|
||||
select ref, decl, kind
|
||||
|
||||
Reference in New Issue
Block a user