Skip to content

Commit 796e71f

Browse files
authored
Merge pull request github#13176 from MaxSchlueter/fixquery12
Fix "Introducing the JavaScript libraries" query12.qll and add test case
2 parents 7d0b02e + 40aa941 commit 796e71f

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

javascript/ql/test/tutorials/Introducing the JavaScript libraries/query12.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ query predicate test_query12(MethodCallExpr send) {
44
exists(SimpleParameter res, DataFlow::Node resNode |
55
res.getName() = "res" and
66
resNode = DataFlow::parameterNode(res) and
7-
resNode.getASuccessor() = DataFlow::valueNode(send.getReceiver()) and
7+
resNode.getASuccessor+() = DataFlow::valueNode(send.getReceiver()) and
88
send.getMethodName() = "send"
99
|
1010
any()

javascript/ql/test/tutorials/Introducing the JavaScript libraries/tests.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ test_query11
2121
| tst.js:31:18:31:18 | x | Dead store of local variable. |
2222
| tst.js:38:7:38:23 | password = "blah" | Dead store of local variable. |
2323
test_query12
24+
| tst.js:42:3:42:12 | res.send() |
2425
test_query20
2526
test_query3
2627
| tst.js:27:1:27:4 | <!-- | Do not use HTML comments. |

javascript/ql/test/tutorials/Introducing the JavaScript libraries/tst.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ var j, j;
3737
function foo() {
3838
var password = "blah";
3939
}
40+
41+
function m(res) {
42+
res.send()
43+
}

0 commit comments

Comments
 (0)