mirror of
https://github.com/github/codeql.git
synced 2026-04-29 02:35:15 +02:00
JS: Add test case for lazy-cache
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
| bar | tst.js:4:11:4:21 | lazy('bar') |
|
||||
| bar | tst.js:10:1:10:8 | lazy.bar |
|
||||
| baz-baz | tst.js:5:1:5:22 | lazy('b ... 'BAZ') |
|
||||
| baz-baz | tst.js:12:1:12:8 | lazy.BAZ |
|
||||
| foo | tst.js:3:1:3:11 | lazy('foo') |
|
||||
| foo | tst.js:7:1:7:8 | lazy.foo |
|
||||
| lazy-cache | tst.js:1:12:1:32 | require ... cache') |
|
||||
@@ -0,0 +1,5 @@
|
||||
import javascript
|
||||
|
||||
query DataFlow::Node moduleImport(string name) {
|
||||
result = DataFlow::moduleImport(name)
|
||||
}
|
||||
12
javascript/ql/test/library-tests/frameworks/LazyCache/tst.js
Normal file
12
javascript/ql/test/library-tests/frameworks/LazyCache/tst.js
Normal file
@@ -0,0 +1,12 @@
|
||||
let lazy = require('lazy-cache')(require);
|
||||
|
||||
lazy('foo');
|
||||
let bar = lazy('bar');
|
||||
lazy('baz-baz', 'BAZ');
|
||||
|
||||
lazy.foo();
|
||||
|
||||
bar();
|
||||
lazy.bar();
|
||||
|
||||
lazy.BAZ();
|
||||
Reference in New Issue
Block a user