mirror of
https://github.com/github/codeql.git
synced 2026-04-27 09:45:15 +02:00
JavaScript: Introduce Type(Back)Tracker::continue predicate.
This commit is contained in:
@@ -168,10 +168,12 @@ class TypeTracker extends TTypeTracker {
|
||||
boolean hasCall() { result = hasCall }
|
||||
|
||||
/**
|
||||
* Gets the property this type has been tracked into, or the empty string if
|
||||
* it has not been tracked into a property.
|
||||
* Gets a type tracker that starts where this one has left off to allow continued
|
||||
* tracking.
|
||||
*
|
||||
* This predicate is only defined if the type has not been tracked into a property.
|
||||
*/
|
||||
string getProp() { result = prop }
|
||||
TypeTracker continue() { prop = "" and result = this }
|
||||
}
|
||||
|
||||
module TypeTracker {
|
||||
@@ -257,10 +259,12 @@ class TypeBackTracker extends TTypeBackTracker {
|
||||
boolean hasReturn() { result = hasReturn }
|
||||
|
||||
/**
|
||||
* Gets the property this type has been tracked into, or the empty string if
|
||||
* it has not been tracked into a property.
|
||||
* Gets a type tracker that starts where this one has left off to allow continued
|
||||
* tracking.
|
||||
*
|
||||
* This predicate is only defined if the type has not been tracked into a property.
|
||||
*/
|
||||
string getProp() { result = prop }
|
||||
TypeBackTracker continue() { prop = "" and result = this }
|
||||
}
|
||||
|
||||
module TypeBackTracker {
|
||||
|
||||
@@ -51,8 +51,7 @@ module SocketIO {
|
||||
// exclude getter versions
|
||||
exists(mcn.getAnArgument()) and
|
||||
result = mcn and
|
||||
t2.getProp() = "" and
|
||||
t = t2
|
||||
t = t2.continue()
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -111,8 +110,7 @@ module SocketIO {
|
||||
or
|
||||
// invocation of a chainable method
|
||||
result = pred.getAMethodCall(namespaceChainableMethod()) and
|
||||
t2.getProp() = "" and
|
||||
t = t2
|
||||
t = t2.continue()
|
||||
or
|
||||
// invocation of chainable getter method
|
||||
exists(string m |
|
||||
@@ -121,8 +119,7 @@ module SocketIO {
|
||||
m = "volatile"
|
||||
|
|
||||
result = pred.getAPropertyRead(m) and
|
||||
t2.getProp() = "" and
|
||||
t = t2
|
||||
t = t2.continue()
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -174,8 +171,7 @@ module SocketIO {
|
||||
m = EventEmitter::chainableMethod()
|
||||
|
|
||||
result = pred.getAMethodCall(m) and
|
||||
t2.getProp() = "" and
|
||||
t = t2
|
||||
t = t2.continue()
|
||||
)
|
||||
or
|
||||
// invocation of a chainable getter method
|
||||
@@ -186,8 +182,7 @@ module SocketIO {
|
||||
m = "volatile"
|
||||
|
|
||||
result = pred.getAPropertyRead(m) and
|
||||
t2.getProp() = "" and
|
||||
t = t2
|
||||
t = t2.continue()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user