mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
JS: Expand test case with call/return matching for backtracking
This commit is contained in:
@@ -7,9 +7,20 @@ test_Connection
|
||||
| tst.js:10:5:10:19 | this.connection |
|
||||
| tst.js:15:10:15:49 | api.cha ... ction() |
|
||||
| tst.js:18:7:18:21 | getConnection() |
|
||||
| tst.js:30:9:30:23 | getConnection() |
|
||||
| tst.js:39:7:39:21 | getConnection() |
|
||||
| tst.js:47:7:47:21 | getConnection() |
|
||||
test_DataCallback
|
||||
| tst.js:9:11:9:12 | cb |
|
||||
| tst.js:20:1:22:1 | functio ... ata);\\n} |
|
||||
| tst.js:29:26:29:27 | cb |
|
||||
| tst.js:32:17:32:26 | data => {} |
|
||||
| tst.js:37:10:37:19 | data => {} |
|
||||
| tst.js:39:32:39:45 | getDataCurry() |
|
||||
| tst.js:44:19:44:20 | cb |
|
||||
| tst.js:47:32:47:60 | identit ... llback) |
|
||||
test_DataValue
|
||||
| tst.js:20:18:20:21 | data |
|
||||
| tst.js:24:19:24:22 | data |
|
||||
| tst.js:32:17:32:20 | data |
|
||||
| tst.js:37:10:37:13 | data |
|
||||
|
||||
@@ -7,9 +7,20 @@ connection
|
||||
| type tracker with call steps | tst.js:10:5:10:19 | this.connection |
|
||||
| type tracker without call steps | tst.js:15:10:15:49 | api.cha ... ction() |
|
||||
| type tracker without call steps | tst.js:18:7:18:21 | getConnection() |
|
||||
| type tracker without call steps | tst.js:30:9:30:23 | getConnection() |
|
||||
| type tracker without call steps | tst.js:39:7:39:21 | getConnection() |
|
||||
| type tracker without call steps | tst.js:47:7:47:21 | getConnection() |
|
||||
dataCallback
|
||||
| tst.js:9:11:9:12 | cb |
|
||||
| tst.js:20:1:22:1 | functio ... ata);\\n} |
|
||||
| tst.js:29:26:29:27 | cb |
|
||||
| tst.js:32:17:32:26 | data => {} |
|
||||
| tst.js:37:10:37:19 | data => {} |
|
||||
| tst.js:39:32:39:45 | getDataCurry() |
|
||||
| tst.js:44:19:44:20 | cb |
|
||||
| tst.js:47:32:47:60 | identit ... llback) |
|
||||
dataValue
|
||||
| tst.js:20:18:20:21 | data |
|
||||
| tst.js:24:19:24:22 | data |
|
||||
| tst.js:32:17:32:20 | data |
|
||||
| tst.js:37:10:37:13 | data |
|
||||
|
||||
@@ -23,3 +23,29 @@ function useData(data) {
|
||||
|
||||
function useData2(data) {
|
||||
}
|
||||
|
||||
|
||||
// Test tracking of callback into function
|
||||
function getDataIndirect(cb) {
|
||||
new C(getConnection()).getData(cb);
|
||||
}
|
||||
getDataIndirect(data => {});
|
||||
getDataIndirect(); // suppress precision gains from single-call special case
|
||||
|
||||
// Test tracking of callback out of function
|
||||
function getDataCurry() {
|
||||
return data => {};
|
||||
}
|
||||
new C(getConnection()).getData(getDataCurry());
|
||||
getDataCurry(); // suppress precision gains from single-call special case
|
||||
|
||||
|
||||
// Test call/return matching of callback tracking
|
||||
function identity(cb) {
|
||||
return cb;
|
||||
}
|
||||
new C(getConnection()).getData(identity(realGetDataCallback));
|
||||
identity(fakeGetDataCallback);
|
||||
|
||||
function realGetDataCallback(data) {} // not found due to missing summarization
|
||||
function fakeGetDataCallback(notData) {} // should not be found
|
||||
|
||||
Reference in New Issue
Block a user