Skip to content

Commit c1cb19a

Browse files
committed
add level PreCallGrapSteps to the callgraph
1 parent f2ecb63 commit c1cb19a

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

javascript/ql/src/semmle/javascript/dataflow/internal/CallGraphs.qll

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
private import javascript
66
private import semmle.javascript.dataflow.internal.StepSummary
7+
private import semmle.javascript.dataflow.internal.PreCallGraphStep
78

89
cached
910
module CallGraph {
@@ -48,6 +49,10 @@ module CallGraph {
4849
t.start() and
4950
AccessPath::step(function, result)
5051
or
52+
t.start() and
53+
imprecision = 0 and
54+
PreCallGraphStep::step(any(DataFlow::Node n | function.flowsTo(n)), result)
55+
or
5156
imprecision = 0 and
5257
exists(DataFlow::ClassNode cls |
5358
exists(string name |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
/** name:reexport.foo */
3+
foo: function foo() {}
4+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const a = require("./a");
2+
3+
module.exports = {
4+
/** name:reexport.bar */
5+
bar: function bar() {},
6+
...a
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const b = require("./b.js");
2+
3+
/** calls:reexport.foo */
4+
b.foo();
5+
6+
/** calls:reexport.bar */
7+
b.bar();

0 commit comments

Comments
 (0)