Skip to content

Commit b4b1810

Browse files
committed
Update NodeJS.qll
1 parent 5e2a1ad commit b4b1810

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

javascript/ql/lib/semmle/javascript/NodeJS.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ class NodeModule extends Module {
5353
private DataFlow::SourceNode getExportsSourceNode() {
5454
result = DataFlow::ssaDefinitionNode(Ssa::implicitInit(this.getExportsVariable()))
5555
or
56+
result = DataFlow::thisNode(this) // `this` is an alias for `module.exports`
57+
or
5658
result = this.getModuleSourceNode().getAPropertyWrite("exports").getRhs().getALocalSource()
5759
or
5860
result = this.getModuleSourceNode().getAPropertyRead("exports")

0 commit comments

Comments
 (0)