JS: analyze assignments in with correctly

This commit is contained in:
Esben Sparre Andreasen
2019-02-25 15:31:53 +01:00
parent 047b69a4c2
commit 0d94fe3f54

View File

@@ -20,7 +20,11 @@ private predicate isEscape(DataFlow::Node escape, string cause) {
or
escape = any(ExportDeclaration e).getSourceNode(_) and cause = "export"
or
any(WithStmt with).mayAffect(escape.asExpr()) and cause = "heap"
exists (WithStmt with, Assignment assign |
with.mayAffect(assign.getLhs()) and
assign.getRhs().flow() = escape and
cause = "heap"
)
}
private DataFlow::Node getAnEscape() {