Skip to content

Commit a8973c1

Browse files
committed
add test for dataflow
1 parent 75ef5b1 commit a8973c1

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

javascript/ql/test/library-tests/DataFlow/tests.expected

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ basicBlock
182182
| tst2.ts:13:39:13:38 | super | tst2.ts:13:39:13:38 | entry node of (...arg ... rgs); } |
183183
| tst2.ts:13:39:13:38 | super(...args) | tst2.ts:13:39:13:38 | entry node of (...arg ... rgs); } |
184184
| tst2.ts:13:39:13:38 | this | tst2.ts:13:39:13:38 | entry node of (...arg ... rgs); } |
185+
| tst2.ts:15:5:15:7 | nd2 | tst2.ts:1:1:1:0 | entry node of <toplevel> |
186+
| tst2.ts:15:5:15:30 | nd2 = A ... number | tst2.ts:1:1:1:0 | entry node of <toplevel> |
187+
| tst2.ts:15:11:15:11 | A | tst2.ts:1:1:1:0 | entry node of <toplevel> |
188+
| tst2.ts:15:11:15:13 | A.x | tst2.ts:1:1:1:0 | entry node of <toplevel> |
189+
| tst2.ts:15:11:15:30 | A.x satisfies number | tst2.ts:1:1:1:0 | entry node of <toplevel> |
190+
| tst2.ts:15:13:15:13 | x | tst2.ts:1:1:1:0 | entry node of <toplevel> |
185191
| tst.js:1:1:1:0 | this | tst.js:1:1:1:0 | entry node of <toplevel> |
186192
| tst.js:1:1:1:1 | x | tst.js:1:1:1:0 | entry node of <toplevel> |
187193
| tst.js:1:1:1:24 | import ... m 'fs'; | tst.js:1:1:1:0 | entry node of <toplevel> |
@@ -674,6 +680,12 @@ enclosingExpr
674680
| tst2.ts:13:39:13:38 | constructor | tst2.ts:13:39:13:38 | constructor |
675681
| tst2.ts:13:39:13:38 | super | tst2.ts:13:39:13:38 | super |
676682
| tst2.ts:13:39:13:38 | super(...args) | tst2.ts:13:39:13:38 | super(...args) |
683+
| tst2.ts:15:5:15:7 | nd2 | tst2.ts:15:5:15:7 | nd2 |
684+
| tst2.ts:15:5:15:30 | nd2 = A ... number | tst2.ts:15:5:15:30 | nd2 = A ... number |
685+
| tst2.ts:15:11:15:11 | A | tst2.ts:15:11:15:11 | A |
686+
| tst2.ts:15:11:15:13 | A.x | tst2.ts:15:11:15:13 | A.x |
687+
| tst2.ts:15:11:15:30 | A.x satisfies number | tst2.ts:15:11:15:30 | A.x satisfies number |
688+
| tst2.ts:15:13:15:13 | x | tst2.ts:15:13:15:13 | x |
677689
| tst.js:1:10:1:11 | fs | tst.js:1:10:1:11 | fs |
678690
| tst.js:1:10:1:11 | fs | tst.js:1:10:1:11 | fs |
679691
| tst.js:1:10:1:11 | fs | tst.js:1:10:1:11 | fs |
@@ -973,6 +985,7 @@ flowStep
973985
| tst2.ts:1:1:1:1 | A | tst2.ts:1:18:1:18 | A |
974986
| tst2.ts:1:8:5:1 | A | tst2.ts:1:18:1:18 | A |
975987
| tst2.ts:1:8:5:1 | A | tst2.ts:11:11:11:11 | A |
988+
| tst2.ts:1:8:5:1 | A | tst2.ts:15:11:15:11 | A |
976989
| tst2.ts:1:8:5:1 | namespa ... lysed\\n} | tst2.ts:1:8:5:1 | A |
977990
| tst2.ts:1:18:1:18 | A | tst2.ts:7:1:7:0 | A |
978991
| tst2.ts:2:14:2:19 | x | tst2.ts:4:3:4:3 | x |
@@ -1159,6 +1172,7 @@ getImmediatePredecessor
11591172
| sources.js:11:14:11:16 | key | sources.js:11:12:11:18 | key |
11601173
| tst2.ts:1:1:1:1 | A | tst2.ts:1:18:1:18 | A |
11611174
| tst2.ts:1:8:5:1 | A | tst2.ts:11:11:11:11 | A |
1175+
| tst2.ts:1:8:5:1 | A | tst2.ts:15:11:15:11 | A |
11621176
| tst2.ts:1:8:5:1 | namespa ... lysed\\n} | tst2.ts:1:8:5:1 | A |
11631177
| tst2.ts:2:14:2:19 | x | tst2.ts:4:3:4:3 | x |
11641178
| tst2.ts:2:18:2:19 | 42 | tst2.ts:2:14:2:19 | x |
@@ -1340,6 +1354,7 @@ incomplete
13401354
| tst2.ts:13:39:13:38 | exceptional return of super(...args) | call |
13411355
| tst2.ts:13:39:13:38 | super | call |
13421356
| tst2.ts:13:39:13:38 | super(...args) | call |
1357+
| tst2.ts:15:11:15:13 | A.x | heap |
13431358
| tst.js:1:10:1:11 | fs | import |
13441359
| tst.js:16:1:20:9 | exceptional return of (functi ... ("arg") | call |
13451360
| tst.js:16:2:20:1 | exceptional return of function f | call |
@@ -1504,6 +1519,7 @@ sources
15041519
| tst2.ts:13:39:13:38 | return of default constructor of class StringList |
15051520
| tst2.ts:13:39:13:38 | super(...args) |
15061521
| tst2.ts:13:39:13:38 | this |
1522+
| tst2.ts:15:11:15:13 | A.x |
15071523
| tst.js:1:1:1:0 | this |
15081524
| tst.js:1:1:1:24 | import ... m 'fs'; |
15091525
| tst.js:1:10:1:11 | fs |

javascript/ql/test/library-tests/DataFlow/tst2.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ function setX() {
1111
var nd2 = A.x as number; // flow through type assertions
1212

1313
class StringList extends List<string> {} // flow through expressions with type arguments
14+
15+
var nd2 = A.x satisfies number; // flow through satisfies expressions

0 commit comments

Comments
 (0)