JS: add test case

This commit is contained in:
Asger F
2019-02-15 13:53:18 +00:00
parent eab034ccfd
commit b31d7d1f5f
3 changed files with 17 additions and 0 deletions

View File

@@ -0,0 +1 @@
| fs | fs | customImport.js:1:12:1:29 | customImport("fs") |

View File

@@ -0,0 +1,15 @@
import javascript
class CustomImport extends DataFlow::ModuleImportNode::Range, DataFlow::CallNode {
CustomImport() {
getCalleeName() = "customImport"
}
override string getPath() {
result = getArgument(0).getStringValue()
}
}
from string path, CustomImport imprt
where imprt = DataFlow::moduleImport(path)
select path, imprt.getPath(), imprt

View File

@@ -0,0 +1 @@
const fs = customImport("fs");