JS: add localFieldStep

This commit is contained in:
Asger F
2019-02-26 12:24:05 +00:00
parent b6648def19
commit 9497199cbd
8 changed files with 57 additions and 0 deletions

View File

@@ -1078,6 +1078,16 @@ module DataFlow {
)
}
/**
* Holds if there is a step from `pred` to `succ` through a field accessed through `this` in a class.
*/
predicate localFieldStep(DataFlow::Node pred, DataFlow::Node succ) {
exists (ClassNode cls, string prop |
pred = cls.getAReceiverNode().getAPropertyWrite(prop).getRhs() and
succ = cls.getAReceiverNode().getAPropertyRead(prop)
)
}
/**
* Gets the data flow node representing the source of definition `def`, taking
* flow through IIFE calls into account.