Skip to content

Commit 3a6e6f9

Browse files
committed
JS: autoformat
1 parent 77d748a commit 3a6e6f9

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

javascript/ql/src/semmle/javascript/dataflow/Configuration.qll

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -663,18 +663,21 @@ private predicate flowThroughProperty(
663663
private predicate summarizedHigherOrderCall(
664664
DataFlow::Node arg, DataFlow::Node cb, int i, DataFlow::Configuration cfg, PathSummary summary
665665
) {
666-
exists (Function f, DataFlow::InvokeNode outer, DataFlow::InvokeNode inner, int j,
667-
DataFlow::Node innerArg, DataFlow::ParameterNode cbParm, PathSummary oldSummary |
666+
exists(
667+
Function f, DataFlow::InvokeNode outer, DataFlow::InvokeNode inner, int j,
668+
DataFlow::Node innerArg, DataFlow::ParameterNode cbParm, PathSummary oldSummary
669+
|
668670
reachableFromInput(f, outer, arg, innerArg, cfg, oldSummary) and
669671
argumentPassing(outer, cb, f, cbParm) and
670-
innerArg = inner.getArgument(j) |
672+
innerArg = inner.getArgument(j)
673+
|
671674
// direct higher-order call
672675
cbParm.flowsTo(inner.getCalleeNode()) and
673676
i = j and
674677
summary = oldSummary
675678
or
676679
// indirect higher-order call
677-
exists (DataFlow::Node cbArg, PathSummary newSummary |
680+
exists(DataFlow::Node cbArg, PathSummary newSummary |
678681
cbParm.flowsTo(cbArg) and
679682
summarizedHigherOrderCall(innerArg, cbArg, i, cfg, newSummary) and
680683
summary = oldSummary.append(PathSummary::call()).append(newSummary)
@@ -696,14 +699,14 @@ predicate higherOrderCall(
696699
PathSummary summary
697700
) {
698701
// Summarized call
699-
exists (DataFlow::Node cb |
702+
exists(DataFlow::Node cb |
700703
summarizedHigherOrderCall(arg, cb, i, cfg, summary) and
701704
callback.flowsTo(cb)
702705
)
703706
or
704707
// Local invocation of a parameter
705708
isRelevant(arg, cfg) and
706-
exists (DataFlow::InvokeNode invoke |
709+
exists(DataFlow::InvokeNode invoke |
707710
arg = invoke.getArgument(i) and
708711
invoke = callback.(DataFlow::ParameterNode).getACall() and
709712
summary = PathSummary::call()
@@ -721,7 +724,6 @@ predicate higherOrderCall(
721724
)
722725
}
723726

724-
725727
/**
726728
* Holds if `pred` is passed as an argument to a function `f` which also takes a
727729
* callback parameter `cb` and then invokes `cb`, passing `pred` into parameter `succ`

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,7 @@ predicate argumentPassing(
109109
* Holds if there is a flow step from `pred` to `succ` through parameter passing
110110
* to a function call.
111111
*/
112-
predicate callStep(DataFlow::Node pred, DataFlow::Node succ) {
113-
argumentPassing(_, pred, _, succ)
114-
}
112+
predicate callStep(DataFlow::Node pred, DataFlow::Node succ) { argumentPassing(_, pred, _, succ) }
115113

116114
/**
117115
* Holds if there is a flow step from `pred` to `succ` through returning
@@ -258,14 +256,14 @@ predicate loadStep(DataFlow::Node pred, DataFlow::PropRead succ, string prop) {
258256
* invocation.
259257
*/
260258
predicate callback(DataFlow::Node arg, DataFlow::SourceNode cb) {
261-
exists (DataFlow::InvokeNode invk, DataFlow::ParameterNode cbParm, DataFlow::Node cbArg |
259+
exists(DataFlow::InvokeNode invk, DataFlow::ParameterNode cbParm, DataFlow::Node cbArg |
262260
arg = invk.getAnArgument() and
263261
cbParm.flowsTo(invk.getCalleeNode()) and
264262
callStep(cbArg, cbParm) and
265263
cb.flowsTo(cbArg)
266264
)
267265
or
268-
exists (DataFlow::ParameterNode cbParm, DataFlow::Node cbArg |
266+
exists(DataFlow::ParameterNode cbParm, DataFlow::Node cbArg |
269267
callback(arg, cbParm) and
270268
callStep(cbArg, cbParm) and
271269
cb.flowsTo(cbArg)

0 commit comments

Comments
 (0)