Skip to content

Commit 1f6df4e

Browse files
committed
JS: Add callback type tracking test
1 parent 2b7882e commit 1f6df4e

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

javascript/ql/test/library-tests/TypeTracking/ClassStyle.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ test_Connection
3838
| tst.js:112:10:112:14 | obj.x |
3939
| tst.js:114:1:114:28 | getX({ ... on() }) |
4040
| tst.js:114:11:114:25 | getConnection() |
41+
| tst.js:118:12:118:26 | getConnection() |
4142
| tst_conflict.js:6:38:6:77 | api.cha ... ction() |
4243
test_DataCallback
4344
| client.js:3:28:3:34 | x => {} |

javascript/ql/test/library-tests/TypeTracking/PredicateStyle.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ connection
4040
| type tracker without call steps | tst.js:108:8:108:22 | getConnection() |
4141
| type tracker without call steps | tst.js:114:1:114:28 | getX({ ... on() }) |
4242
| type tracker without call steps | tst.js:114:11:114:25 | getConnection() |
43+
| type tracker without call steps | tst.js:118:12:118:26 | getConnection() |
4344
| type tracker without call steps | tst_conflict.js:6:38:6:77 | api.cha ... ction() |
4445
| type tracker without call steps with property MyApplication.namespace.connection | file://:0:0:0:0 | global access path |
4546
| type tracker without call steps with property conflict | tst.js:63:3:63:25 | MyAppli ... mespace |

javascript/ql/test/library-tests/TypeTracking/tst.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,15 @@ function getX(obj) {
113113
}
114114
getX({ x: getConnection() });
115115
getX({ x: somethingElse() });
116+
117+
function makeConnectionAsync(callback) {
118+
callback(getConnection());
119+
}
120+
makeConnectionAsync(conn => {});
121+
makeConnectionAsync(); // suppress single-call precision gains
122+
123+
function makeConnectionAsync2(callback) {
124+
makeConnectionAsync(callback);
125+
}
126+
makeConnectionAsync2(conn => {});
127+
makeConnectionAsync2(); // suppress single-call precision gains

0 commit comments

Comments
 (0)