Skip to content

Commit 7954665

Browse files
committed
JS: More API graph optimizations
1 parent 945fa68 commit 7954665

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

javascript/ql/lib/semmle/javascript/ApiGraphs.qll

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ module API {
10411041
)
10421042
or
10431043
// property reads
1044-
exists(DataFlow::SourceNode src, DataFlow::SourceNode pred, string propDesc |
1044+
exists(RawSourceNode src, RawSourceNode pred, string propDesc |
10451045
use(base, src) and
10461046
pred = trackUseNode(src, false, 0, propDesc) and
10471047
propertyRead(pred, propDesc, lbl, ref) and
@@ -1050,9 +1050,7 @@ module API {
10501050
(base instanceof TNonModuleDef or base instanceof TUse)
10511051
)
10521052
or
1053-
exists(DataFlow::SourceNode src, DataFlow::SourceNode pred |
1054-
use(base, src) and pred = trackUseNode(src)
1055-
|
1053+
exists(RawSourceNode src, RawSourceNode pred | use(base, src) and pred = trackUseNode(src) |
10561054
lbl = Label::instance() and
10571055
ref = pred.getAnInstantiation()
10581056
or
@@ -1263,13 +1261,23 @@ module API {
12631261

12641262
predicate flowsToExpr(Expr expr) { this.(DataFlow::SourceNode).flowsToExpr(expr) }
12651263

1264+
DataFlow::Node getALocalUse() { result = this.(DataFlow::SourceNode).getALocalUse() }
1265+
12661266
DataFlow::PropRead getAPropertyRead(string prop) {
12671267
result = this.(DataFlow::SourceNode).getAPropertyRead(prop)
12681268
}
12691269

12701270
DataFlow::PropWrite getAPropertyWrite() {
12711271
result = this.(DataFlow::SourceNode).getAPropertyWrite()
12721272
}
1273+
1274+
DataFlow::InvokeNode getAnInvocation() {
1275+
result = this.(DataFlow::SourceNode).getAnInvocation()
1276+
}
1277+
1278+
DataFlow::NewNode getAnInstantiation() {
1279+
result = this.(DataFlow::SourceNode).getAnInstantiation()
1280+
}
12731281
}
12741282

12751283
/**

0 commit comments

Comments
 (0)