Skip to content

Commit 3479f02

Browse files
committed
JS: Add test showing lack of flow out of inner function
1 parent 76438f9 commit 3479f02

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ test_Connection
2424
| tst.js:63:38:63:77 | api.cha ... ction() |
2525
| tst.js:67:14:67:47 | MyAppli ... nection |
2626
| tst.js:78:35:78:49 | getConnection() |
27+
| tst.js:80:16:80:19 | conn |
28+
| tst.js:84:22:84:22 | x |
29+
| tst.js:96:7:96:21 | getConnection() |
2730
| tst_conflict.js:6:38:6:77 | api.cha ... ction() |
2831
test_DataCallback
2932
| client.js:3:28:3:34 | x => {} |

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ apiObject
1212
connection
1313
| type tracker with call steps | tst.js:7:15:7:18 | conn |
1414
| type tracker with call steps | tst.js:11:5:11:19 | this.connection |
15+
| type tracker with call steps | tst.js:80:16:80:19 | conn |
16+
| type tracker with call steps | tst.js:84:22:84:22 | x |
1517
| type tracker with call steps with property connection | tst.js:7:14:7:13 | this |
1618
| type tracker without call steps | client.js:1:10:1:27 | exportedConnection |
1719
| type tracker without call steps | tst.js:16:10:16:49 | api.cha ... ction() |
@@ -25,6 +27,7 @@ connection
2527
| type tracker without call steps | tst.js:63:38:63:77 | api.cha ... ction() |
2628
| type tracker without call steps | tst.js:67:14:67:47 | MyAppli ... nection |
2729
| type tracker without call steps | tst.js:78:35:78:49 | getConnection() |
30+
| type tracker without call steps | tst.js:96:7:96:21 | getConnection() |
2831
| type tracker without call steps | tst_conflict.js:6:38:6:77 | api.cha ... ction() |
2932
| type tracker without call steps with property MyApplication.namespace.connection | file://:0:0:0:0 | global access path |
3033
| 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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,21 @@ function useConnection() {
7676
}
7777

7878
export const exportedConnection = getConnection();
79+
80+
function outer(conn) {
81+
function innerCapture() {
82+
return conn;
83+
}
84+
function innerCall(x) {
85+
return x;
86+
}
87+
88+
innerCapture();
89+
innerCall(conn);
90+
innerCall(somethingElse());
91+
92+
function otherInner() {
93+
innerCapture();
94+
}
95+
}
96+
outer(getConnection());

0 commit comments

Comments
 (0)