JavaScript: Expose an API-graph predicate that is useful for flow summaries.

This commit is contained in:
Max Schaefer
2020-09-10 08:44:06 +01:00
parent b8a492473b
commit b71a8e2ad0

View File

@@ -169,9 +169,9 @@ module API {
predicate refersTo(Node that) { this.getARhs() = that.getAUse() }
/**
* Gets the unique data-flow that gives rise to this node, if any.
* Gets the data-flow node that gives rise to this node, if any.
*/
private DataFlow::Node getRepresentativeNode() {
DataFlow::Node getInducingNode() {
this = Impl::MkClassInstance(result) or
this = Impl::MkUse(result) or
this = Impl::MkDef(result) or
@@ -186,9 +186,9 @@ module API {
* parameters are zero.
*/
predicate hasLocationInfo(string path, int startline, int startcol, int endline, int endcol) {
getRepresentativeNode().hasLocationInfo(path, startline, startcol, endline, endcol)
getInducingNode().hasLocationInfo(path, startline, startcol, endline, endcol)
or
not exists(getRepresentativeNode()) and
not exists(getInducingNode()) and
path = "" and
startline = 0 and
startcol = 0 and