Skip to content

Commit 125c6a0

Browse files
authored
Merge pull request #2787 from asger-semmle/js/lazy-cache-test-case
Approved by esbena
2 parents 4cbf7d2 + a2fa6bb commit 125c6a0

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
| bar | tst.js:4:11:4:21 | lazy('bar') |
2+
| bar | tst.js:10:1:10:8 | lazy.bar |
3+
| baz-baz | tst.js:5:1:5:22 | lazy('b ... 'BAZ') |
4+
| baz-baz | tst.js:12:1:12:8 | lazy.BAZ |
5+
| foo | tst.js:3:1:3:11 | lazy('foo') |
6+
| foo | tst.js:7:1:7:8 | lazy.foo |
7+
| lazy-cache | tst.js:1:12:1:32 | require ... cache') |
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import javascript
2+
3+
query DataFlow::Node moduleImport(string name) {
4+
result = DataFlow::moduleImport(name)
5+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
let lazy = require('lazy-cache')(require);
2+
3+
lazy('foo');
4+
let bar = lazy('bar');
5+
lazy('baz-baz', 'BAZ');
6+
7+
lazy.foo();
8+
9+
bar();
10+
lazy.bar();
11+
12+
lazy.BAZ();

0 commit comments

Comments
 (0)