JS: model one more 'autobind' for js/unbound-event-handler-receiver

This commit is contained in:
Esben Sparre Andreasen
2019-02-21 08:23:54 +01:00
parent 5754eb666c
commit 27cae0c190
2 changed files with 24 additions and 2 deletions

View File

@@ -28,7 +28,11 @@ private predicate isBoundInMethod(MethodDeclaration method) {
)
or
// require("auto-bind")(this)
thiz.flowsTo(DataFlow::moduleImport("auto-bind").getACall().getArgument(0))
exists (string mod |
mod = "auto-bind" or
mod = "react-autobind" |
thiz.flowsTo(DataFlow::moduleImport(mod).getACall().getArgument(0))
)
or
exists(string name | name = method.getName() |
exists(DataFlow::MethodCallNode bind |