-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
The current CodeQL for JavaScript library class Module
fails to capture irregular JavaScript code that mixes ES2015 modules and CommonJS ones. This means that the code like below fails to register as a Module
:
import fs from "fs";
module.exports = (srv) => { srv.on(...) }
This makes capturing the portion (srv) => { srv.on(...) }
above impossible using standard library code. The current hack is to describe the property write directly in a low-level fashion:
exists(PropWrite moduleExports |
moduleExports.getBase().asExpr().(VarAccess).getName() = "module" and
moduleExports.getPropertyName() = "exports" and
this = moduleExports.getRhs()
)
But this is obviously not ideal. Therefore, after the CodeQL Standard Library for JavaScript is fixed, remove the above code and replace it with any(Module module_).getABulkExportedNode()
.
Metadata
Metadata
Assignees
Labels
No labels