mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
add support for private fields in classes
This commit is contained in:
17
javascript/ql/test/library-tests/Classes/ClassFlow.qll
Normal file
17
javascript/ql/test/library-tests/Classes/ClassFlow.qll
Normal file
@@ -0,0 +1,17 @@
|
||||
import javascript
|
||||
|
||||
class Configuration extends DataFlow::Configuration {
|
||||
Configuration() { this = "ClassDataFlowTestingConfig" }
|
||||
|
||||
override predicate isSource(DataFlow::Node source) {
|
||||
source.getEnclosingExpr().(StringLiteral).getValue().toLowerCase() = "source"
|
||||
}
|
||||
|
||||
override predicate isSink(DataFlow::Node sink) {
|
||||
any(DataFlow::CallNode call | call.getCalleeName() = "sink").getAnArgument() = sink
|
||||
}
|
||||
}
|
||||
|
||||
query predicate dataflow(DataFlow::Node pred, DataFlow::Node succ) {
|
||||
any(Configuration c).hasFlow(pred, succ)
|
||||
}
|
||||
Reference in New Issue
Block a user