File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed
javascript/ql/test/library-tests/Routing Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change 1+ legacyDataFlowDifference
2+ consistencyIssue
Original file line number Diff line number Diff line change @@ -3,18 +3,34 @@ import testUtilities.ConsistencyChecking
33
44API:: Node testInstance ( ) { result = API:: moduleImport ( "@example/test" ) .getInstance ( ) }
55
6- class Taint extends TaintTracking:: Configuration {
7- Taint ( ) { this = "Taint" }
8-
9- override predicate isSource ( DataFlow:: Node node ) {
6+ module TestConfig implements DataFlow:: ConfigSig {
7+ predicate isSource ( DataFlow:: Node node ) {
108 node .( DataFlow:: CallNode ) .getCalleeName ( ) = "source"
119 or
1210 node = testInstance ( ) .getMember ( "getSource" ) .getReturn ( ) .asSource ( )
1311 }
1412
15- override predicate isSink ( DataFlow:: Node node ) {
13+ predicate isSink ( DataFlow:: Node node ) {
1614 node = any ( DataFlow:: CallNode call | call .getCalleeName ( ) = "sink" ) .getAnArgument ( )
1715 or
1816 node = testInstance ( ) .getMember ( "getSink" ) .getAParameter ( ) .asSink ( )
1917 }
2018}
19+
20+ module TestFlow = TaintTracking:: Global< TestConfig > ;
21+
22+ class Consistency extends ConsistencyConfiguration {
23+ Consistency ( ) { this = "Consistency" }
24+
25+ override DataFlow:: Node getAnAlert ( ) { TestFlow:: flowTo ( result ) }
26+ }
27+
28+ class LegacyConfig extends TaintTracking:: Configuration {
29+ LegacyConfig ( ) { this = "LegacyConfig" }
30+
31+ override predicate isSource ( DataFlow:: Node source ) { TestConfig:: isSource ( source ) }
32+
33+ override predicate isSink ( DataFlow:: Node sink ) { TestConfig:: isSink ( sink ) }
34+ }
35+
36+ import testUtilities.LegacyDataFlowDiff:: DataFlowDiff< TestFlow , LegacyConfig >
You can’t perform that action at this time.
0 commit comments