Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b31d7d1

Browse files
committed
JS: add test case
1 parent eab034c commit b31d7d1

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| fs | fs | customImport.js:1:12:1:29 | customImport("fs") |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import javascript
2+
3+
class CustomImport extends DataFlow::ModuleImportNode::Range, DataFlow::CallNode {
4+
CustomImport() {
5+
getCalleeName() = "customImport"
6+
}
7+
8+
override string getPath() {
9+
result = getArgument(0).getStringValue()
10+
}
11+
}
12+
13+
from string path, CustomImport imprt
14+
where imprt = DataFlow::moduleImport(path)
15+
select path, imprt.getPath(), imprt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const fs = customImport("fs");

0 commit comments

Comments
 (0)