File tree Expand file tree Collapse file tree
javascript/ql/test/library-tests/Arrays Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ legacyDataFlowDifference
2+ flow
13| arrays.js:2:16:2:23 | "source" | arrays.js:5:8:5:14 | obj.foo |
24| arrays.js:2:16:2:23 | "source" | arrays.js:11:10:11:15 | arr[i] |
35| arrays.js:2:16:2:23 | "source" | arrays.js:15:27:15:27 | e |
Original file line number Diff line number Diff line change 11import javascript
22
3- class ArrayFlowConfig extends DataFlow:: Configuration {
4- ArrayFlowConfig ( ) { this = "ArrayFlowConfig " }
3+ module TestConfig implements DataFlow:: ConfigSig {
4+ predicate isSource ( DataFlow :: Node source ) { source . asExpr ( ) . getStringValue ( ) = "source " }
55
6- override predicate isSource ( DataFlow:: Node source ) { source .asExpr ( ) .getStringValue ( ) = "source" }
7-
8- override predicate isSink ( DataFlow:: Node sink ) {
6+ predicate isSink ( DataFlow:: Node sink ) {
97 sink = any ( DataFlow:: CallNode call | call .getCalleeName ( ) = "sink" ) .getAnArgument ( )
108 }
119}
1210
13- from ArrayFlowConfig config , DataFlow:: Node src , DataFlow:: Node snk
14- where config .hasFlow ( src , snk )
15- select src , snk
11+ module TestFlow = DataFlow:: Global< TestConfig > ;
12+
13+ class LegacyConfig extends DataFlow:: Configuration {
14+ LegacyConfig ( ) { this = "LegacyConfig" }
15+
16+ override predicate isSource ( DataFlow:: Node source ) { TestConfig:: isSource ( source ) }
17+
18+ override predicate isSink ( DataFlow:: Node sink ) { TestConfig:: isSink ( sink ) }
19+ }
20+
21+ import testUtilities.LegacyDataFlowDiff:: DataFlowDiff< TestFlow , LegacyConfig >
22+
23+ query predicate flow = TestFlow:: flow / 2 ;
Original file line number Diff line number Diff line change 1+ legacyDataFlowDifference
2+ flow
13| arrays.js:2:16:2:23 | "source" | arrays.js:5:8:5:14 | obj.foo |
24| arrays.js:2:16:2:23 | "source" | arrays.js:11:10:11:15 | arr[i] |
35| arrays.js:2:16:2:23 | "source" | arrays.js:15:27:15:27 | e |
Original file line number Diff line number Diff line change 11import javascript
22
3- class ArrayTaintFlowConfig extends TaintTracking :: Configuration {
4- ArrayTaintFlowConfig ( ) { this = "ArrayTaintFlowConfig " }
3+ module TestConfig implements DataFlow :: ConfigSig {
4+ predicate isSource ( DataFlow :: Node source ) { source . asExpr ( ) . getStringValue ( ) = "source " }
55
6- override predicate isSource ( DataFlow:: Node source ) { source .asExpr ( ) .getStringValue ( ) = "source" }
7-
8- override predicate isSink ( DataFlow:: Node sink ) {
6+ predicate isSink ( DataFlow:: Node sink ) {
97 sink = any ( DataFlow:: CallNode call | call .getCalleeName ( ) = "sink" ) .getAnArgument ( )
108 }
119}
1210
13- from ArrayTaintFlowConfig config , DataFlow:: Node src , DataFlow:: Node snk
14- where config .hasFlow ( src , snk )
15- select src , snk
11+ module TestFlow = TaintTracking:: Global< TestConfig > ;
12+
13+ class LegacyConfig extends TaintTracking:: Configuration {
14+ LegacyConfig ( ) { this = "LegacyConfig" }
15+
16+ override predicate isSource ( DataFlow:: Node source ) { TestConfig:: isSource ( source ) }
17+
18+ override predicate isSink ( DataFlow:: Node sink ) { TestConfig:: isSink ( sink ) }
19+ }
20+
21+ import testUtilities.LegacyDataFlowDiff:: DataFlowDiff< TestFlow , LegacyConfig >
22+
23+ query predicate flow = TestFlow:: flow / 2 ;
You can’t perform that action at this time.
0 commit comments