Skip to content

Commit 3aaa2d1

Browse files
committed
rename decoratedRouteHandler to isDecoratedCall
1 parent 0b16f81 commit 3aaa2d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

javascript/ql/src/semmle/javascript/frameworks/Express.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ module Express {
7676
* Holds if `call` decorates the function `pred`.
7777
* This means that `call` returns a function that forwards its arguments to `pred`.
7878
*/
79-
predicate decoratedRouteHandler(DataFlow::SourceNode pred, DataFlow::CallNode call) {
79+
predicate isDecoratedCall(DataFlow::CallNode call, DataFlow::FunctionNode decoratee) {
8080
// indirect route-handler `result` is given to function `outer`, which returns function `inner` which calls the function `pred`.
8181
exists(int i, Function outer, Function inner |
82-
pred = call.getArgument(i).getALocalSource() and
82+
decoratee = call.getArgument(i).getALocalSource() and
8383
outer = call.getACallee() and
8484
inner = outer.getAReturnedExpr() and
8585
forwardingCall(DataFlow::parameterNode(outer.getParameter(i)), inner.flow())
@@ -103,7 +103,7 @@ module Express {
103103
* Holds if there exists a step from `pred` to `succ` for a RouteHandler - beyond the usual steps defined by TypeTracking.
104104
*/
105105
predicate routeHandlerStep(DataFlow::SourceNode pred, DataFlow::SourceNode succ) {
106-
decoratedRouteHandler(pred, succ)
106+
isDecoratedCall(succ, pred)
107107
or
108108
// A forwarding call
109109
forwardingCall(pred, succ)

javascript/ql/src/semmle/javascript/frameworks/HTTP.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ module HTTP {
596596
DataFlow::SourceNode getAPossiblyDecoratedHandler(RouteHandlerCandidate candidate) {
597597
result = candidate
598598
or
599-
Express::decoratedRouteHandler(candidate, result)
599+
Express::isDecoratedCall(result, candidate)
600600
}
601601

602602
/**

0 commit comments

Comments
 (0)