Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 48b70c4

Browse files
committed
JS: Add type-tracking test case
1 parent 7315a2b commit 48b70c4

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ test_ApiObject
22
| tst.js:4:11:4:21 | new myapi() |
33
| tst.js:16:10:16:21 | api.chain1() |
44
| tst.js:16:10:16:30 | api.cha ... hain2() |
5+
| tst.js:62:40:62:51 | api.chain1() |
6+
| tst.js:62:40:62:60 | api.cha ... hain2() |
57
test_Connection
68
| tst.js:7:15:7:18 | conn |
79
| tst.js:11:5:11:19 | this.connection |
@@ -12,6 +14,8 @@ test_Connection
1214
| tst.js:48:7:48:21 | getConnection() |
1315
| tst.js:54:37:54:51 | getConnection() |
1416
| tst.js:57:14:57:48 | config. ... ction') |
17+
| tst.js:62:40:62:79 | api.cha ... ction() |
18+
| tst.js:66:14:66:47 | MyAppli ... nection |
1519
test_DataCallback
1620
| tst.js:10:11:10:12 | cb |
1721
| tst.js:21:1:23:1 | functio ... ata);\\n} |
@@ -22,9 +26,11 @@ test_DataCallback
2226
| tst.js:45:19:45:20 | cb |
2327
| tst.js:48:32:48:60 | identit ... llback) |
2428
| tst.js:58:16:58:22 | x => {} |
29+
| tst.js:67:16:69:3 | data => ... a);\\n } |
2530
test_DataValue
2631
| tst.js:21:18:21:21 | data |
2732
| tst.js:25:19:25:22 | data |
2833
| tst.js:33:17:33:20 | data |
2934
| tst.js:38:10:38:13 | data |
3035
| tst.js:58:16:58:16 | x |
36+
| tst.js:67:16:67:19 | data |

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ apiObject
22
| tst.js:4:11:4:21 | new myapi() |
33
| tst.js:16:10:16:21 | api.chain1() |
44
| tst.js:16:10:16:30 | api.cha ... hain2() |
5+
| tst.js:62:40:62:51 | api.chain1() |
6+
| tst.js:62:40:62:60 | api.cha ... hain2() |
57
connection
68
| type tracker with call steps | tst.js:7:15:7:18 | conn |
79
| type tracker with call steps | tst.js:11:5:11:19 | this.connection |
@@ -13,6 +15,10 @@ connection
1315
| type tracker without call steps | tst.js:48:7:48:21 | getConnection() |
1416
| type tracker without call steps | tst.js:54:37:54:51 | getConnection() |
1517
| type tracker without call steps | tst.js:57:14:57:48 | config. ... ction') |
18+
| type tracker without call steps | tst.js:62:40:62:79 | api.cha ... ction() |
19+
| type tracker without call steps | tst.js:66:14:66:47 | MyAppli ... nection |
20+
| type tracker without call steps with property MyApplication.namespace.connection | file://:0:0:0:0 | global access path |
21+
| type tracker without call steps with property connection | tst.js:62:3:62:25 | MyAppli ... mespace |
1622
dataCallback
1723
| tst.js:10:11:10:12 | cb |
1824
| tst.js:21:1:23:1 | functio ... ata);\\n} |
@@ -23,9 +29,11 @@ dataCallback
2329
| tst.js:45:19:45:20 | cb |
2430
| tst.js:48:32:48:60 | identit ... llback) |
2531
| tst.js:58:16:58:22 | x => {} |
32+
| tst.js:67:16:69:3 | data => ... a);\\n } |
2633
dataValue
2734
| tst.js:21:18:21:21 | data |
2835
| tst.js:25:19:25:22 | data |
2936
| tst.js:33:17:33:20 | data |
3037
| tst.js:38:10:38:13 | data |
3138
| tst.js:58:16:58:16 | x |
39+
| tst.js:67:16:67:19 | data |

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,14 @@ function getFromConfigFramework() {
5757
let conn = config.getConfigValue('connection');
5858
conn.getData(x => {});
5959
}
60+
61+
function initConnection() {
62+
MyApplication.namespace.connection = api.chain1().chain2().createConnection();
63+
}
64+
65+
function useConnection() {
66+
let conn = MyApplication.namespace.connection;
67+
conn.getData(data => {
68+
useData(data);
69+
});
70+
}

0 commit comments

Comments
 (0)