@@ -209,26 +209,25 @@ module Spife {
209
209
* route handler.
210
210
*/
211
211
private class ReplyCall extends API:: CallNode {
212
+ boolean isDirectReplyCall ;
213
+
212
214
ReplyCall ( ) {
213
215
// reply(resp)
214
- this = API:: moduleImport ( [ "@npm/spife/reply" , "spife/reply" ] ) .getACall ( )
216
+ this = API:: moduleImport ( [ "@npm/spife/reply" , "spife/reply" ] ) .getACall ( ) and
217
+ isDirectReplyCall = true
215
218
or
216
219
// reply.header(resp, 'foo', 'bar')
217
- this = API:: moduleImport ( [ "@npm/spife/reply" , "spife/reply" ] ) .getAMember ( ) .getACall ( )
220
+ this = API:: moduleImport ( [ "@npm/spife/reply" , "spife/reply" ] ) .getAMember ( ) .getACall ( ) and
221
+ isDirectReplyCall = false
218
222
}
219
223
220
- predicate isDirectReplyCall ( ) {
221
- this = API:: moduleImport ( [ "@npm/spife/reply" , "spife/reply" ] ) .getACall ( )
222
- }
224
+ predicate isDirectReplyCall ( ) { isDirectReplyCall = true }
223
225
224
226
/**
225
227
* Gets the route handler that provides this response.
226
228
*/
227
229
RouteHandler getRouteHandler ( ) {
228
- exists ( RouteHandler handler |
229
- handler .getAReturn ( ) = this .getReturn ( ) .getAValueReachableFromSource ( ) and
230
- result = handler
231
- )
230
+ result .getAReturn ( ) = this .getReturn ( ) .getAValueReachableFromSource ( )
232
231
}
233
232
}
234
233
@@ -248,9 +247,7 @@ module Spife {
248
247
headerValue = super .getArgument ( 2 )
249
248
}
250
249
251
- override DataFlow:: Node getNameNode ( ) {
252
- result = super .getArgument ( 1 )
253
- }
250
+ override DataFlow:: Node getNameNode ( ) { result = super .getArgument ( 1 ) }
254
251
255
252
override RouteHandler getRouteHandler ( ) { result = ReplyCall .super .getRouteHandler ( ) }
256
253
}
@@ -380,14 +377,14 @@ module Spife {
380
377
* An object passed to the `template` method of the reply object.
381
378
*/
382
379
private class TemplateObjectInput extends DataFlow:: Node {
383
- TemplateCall call ;
380
+ ReplyCall call ;
384
381
385
- TemplateObjectInput ( ) { this = call .( ReplyCall ) . getArgument ( 1 ) }
382
+ TemplateObjectInput ( ) { this = call .getArgument ( 1 ) }
386
383
387
384
/**
388
385
* Gets the route handler that uses this object.
389
386
*/
390
- RouteHandler getRouteHandler ( ) { result = call .( ReplyCall ) . getRouteHandler ( ) }
387
+ RouteHandler getRouteHandler ( ) { result = call .getRouteHandler ( ) }
391
388
}
392
389
393
390
/**
0 commit comments