mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
recognize modules imported by AMD imports as library inputs
This commit is contained in:
@@ -87,6 +87,15 @@ private DataFlow::Node getAValueExportedByPackage() {
|
||||
result = getAnExportFromModule(mod)
|
||||
)
|
||||
or
|
||||
// require("./other-module.js"); inside an AMD module.
|
||||
exists(Module mod, CallExpr call |
|
||||
call = getAValueExportedByPackage().asExpr() and
|
||||
call = any(AmdModuleDefinition e).getARequireCall() and
|
||||
mod = call.getAnArgument().(Import).getImportedModule()
|
||||
|
|
||||
result = getAnExportFromModule(mod)
|
||||
)
|
||||
or
|
||||
// module.exports = class Foo {
|
||||
// bar() {} // <- result
|
||||
// static baz() {} // <- result
|
||||
|
||||
Reference in New Issue
Block a user