Files
Asger F 03bdebe3b3 JS: Update a test.
The test had a bug on the line `src = src` so the new code is "more equivalent than usual"
2023-07-11 15:24:09 +02:00

29 lines
815 B
Plaintext

import javascript
class TestDataFlowConfiguration extends DataFlow::Configuration {
TestDataFlowConfiguration() { this = "TestDataFlowConfiguration" }
override predicate isSource(DataFlow::Node src) {
exists(VariableDeclarator vd |
vd.getBindingPattern().(VarDecl).getName().matches("%source%") and
src.asExpr() = vd.getInit()
)
}
override predicate isSink(DataFlow::Node snk) {
exists(VariableDeclarator vd |
vd.getBindingPattern().(VarDecl).getName().matches("%sink%") and
snk.asExpr() = vd.getInit()
)
}
override predicate isBarrier(DataFlow::Node node) {
exists(Function f |
f.getName().matches("%noReturnTracking%") and
node = f.getAReturnedExpr().flow()
)
or
node.asExpr().(PropAccess).getPropertyName() = "notTracked"
}
}