mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
JS: use JSDoc types in class tracking
This commit is contained in:
@@ -709,6 +709,12 @@ class ClassNode extends DataFlow::SourceNode {
|
||||
t.start() and
|
||||
result = getAReceiverNode()
|
||||
or
|
||||
t.call() and
|
||||
exists(Parameter param |
|
||||
this = param.getTypeAnnotation().getClass() and
|
||||
result = DataFlow::parameterNode(param)
|
||||
)
|
||||
or
|
||||
result = getAnInstanceReferenceAux(t) and
|
||||
// Avoid tracking into the receiver of other classes.
|
||||
// Note that this also blocks flows into a property of the receiver,
|
||||
|
||||
@@ -158,6 +158,12 @@ class TypeTracker extends TTypeTracker {
|
||||
*/
|
||||
predicate start() { hasCall = false and prop = "" }
|
||||
|
||||
/**
|
||||
* Holds if this is the starting point of type tracking
|
||||
* when tracking a parameter into a call, but not out of it.
|
||||
*/
|
||||
predicate call() { hasCall = true and prop = "" }
|
||||
|
||||
/**
|
||||
* Holds if this is the end point of type tracking.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user