File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
javascript/ql/src/semmle/javascript/frameworks Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -127,10 +127,12 @@ module Express {
127127 Expr getRouteHandlerExpr ( int index ) {
128128 // The first argument is a URI pattern if it is a string. If it could possibly be
129129 // a function, we consider it to be a route handler, otherwise a URI pattern.
130- if getArgument ( 0 ) .analyze ( ) .getAType ( ) = TTFunction ( ) then
131- result = getArgument ( index )
132- else
133- ( index >= 0 and result = getArgument ( index + 1 ) )
130+ exists ( AnalyzedNode firstArg | firstArg = getArgument ( 0 ) .analyze ( ) |
131+ if firstArg .getAType ( ) = TTFunction ( ) then
132+ result = getArgument ( index )
133+ else
134+ ( index >= 0 and result = getArgument ( index + 1 ) )
135+ )
134136 }
135137
136138 /** Gets an argument that represents a route handler being registered. */
You can’t perform that action at this time.
0 commit comments