JS: simplify charpred for NodeJS::Require

This commit is contained in:
Esben Sparre Andreasen
2019-11-28 07:55:54 +01:00
parent eaf68e86e0
commit d909653a6b

View File

@@ -163,11 +163,9 @@ private predicate moduleInFile(Module m, File f) { m.getFile() = f }
*/
class Require extends CallExpr, Import {
Require() {
exists(RequireVariable req |
this.getCallee() = req.getAnAccess() and
// `mjs` files explicitly disallow `require`
not getFile().getExtension() = "mjs"
)
any(RequireVariable req).getAnAccess() = getCallee() and
// `mjs` files explicitly disallow `require`
not getFile().getExtension() = "mjs"
}
override PathExpr getImportedPath() { result = getArgument(0) }