Skip to content

Commit 2987929

Browse files
committed
JS: Add test showing missed call to later-defined function in block
1 parent e39ad94 commit 2987929

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

javascript/ql/test/library-tests/CallGraphs/AnnotatedTest/Test.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ spuriousCallee
22
missingCallee
33
| constructor-field.ts:40:5:40:14 | f3.build() | constructor-field.ts:13:3:13:12 | build() {} | -1 | calls |
44
| constructor-field.ts:71:1:71:11 | bf3.build() | constructor-field.ts:13:3:13:12 | build() {} | -1 | calls |
5+
| hoisted.js:20:9:20:11 | f() | hoisted.js:23:9:23:23 | function f() {} | -1 | calls |
56
badAnnotation
67
accessorCall
78
| accessors.js:12:1:12:5 | obj.f | accessors.js:5:8:5:12 | () {} |
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
function test1() {
2+
/** name:hoist1 */
3+
function f() {}
4+
5+
/** calls:hoist1 */
6+
f();
7+
}
8+
9+
function test2() {
10+
/** calls:hoist2 */
11+
f();
12+
13+
/** name:hoist2 */
14+
function f() {}
15+
}
16+
17+
function test3() {
18+
{
19+
/** calls:hoist3 */
20+
f();
21+
22+
/** name:hoist3 */
23+
function f() {}
24+
}
25+
}

0 commit comments

Comments
 (0)