Skip to content

Commit bafe5e3

Browse files
committed
JS: Add test case (with old expected data)
1 parent 9a08c27 commit bafe5e3

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

javascript/ql/test/library-tests/TaintTracking/BasicTaintTracking.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ typeInferenceMismatch
154154
| json-stringify.js:2:16:2:23 | source() | json-stringify.js:42:8:42:51 | JSON.st ... urce))) |
155155
| json-stringify.js:2:16:2:23 | source() | json-stringify.js:45:8:45:23 | fastJson(source) |
156156
| json-stringify.js:3:15:3:22 | source() | json-stringify.js:8:8:8:31 | jsonStr ... (taint) |
157+
| logical-and.js:2:17:2:24 | source() | logical-and.js:4:10:4:24 | "safe" && taint |
158+
| logical-and.js:2:17:2:24 | source() | logical-and.js:5:10:5:24 | taint && "safe" |
157159
| nested-props.js:4:13:4:20 | source() | nested-props.js:5:10:5:14 | obj.x |
158160
| nested-props.js:9:18:9:25 | source() | nested-props.js:10:10:10:16 | obj.x.y |
159161
| nested-props.js:35:13:35:20 | source() | nested-props.js:36:10:36:20 | doLoad(obj) |

javascript/ql/test/library-tests/TaintTracking/DataFlowTracking.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@
7373
| importedReactComponent.jsx:4:40:4:47 | source() | exportedReactComponent.jsx:2:10:2:19 | props.text |
7474
| indexOf.js:4:11:4:18 | source() | indexOf.js:9:10:9:10 | x |
7575
| indexOf.js:4:11:4:18 | source() | indexOf.js:13:10:13:10 | x |
76+
| logical-and.js:2:17:2:24 | source() | logical-and.js:4:10:4:24 | "safe" && taint |
77+
| logical-and.js:2:17:2:24 | source() | logical-and.js:5:10:5:24 | taint && "safe" |
7678
| nested-props.js:4:13:4:20 | source() | nested-props.js:5:10:5:14 | obj.x |
7779
| nested-props.js:9:18:9:25 | source() | nested-props.js:10:10:10:16 | obj.x.y |
7880
| nested-props.js:35:13:35:20 | source() | nested-props.js:36:10:36:20 | doLoad(obj) |
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function test() {
2+
var taint = source();
3+
4+
sink("safe" && taint); // NOT OK
5+
sink(taint && "safe"); // OK
6+
}

0 commit comments

Comments
 (0)