1
- /**
1
+ /**
2
2
* Provides classes for working with [SockJS](http://sockjs.org).
3
3
*/
4
4
@@ -9,25 +9,26 @@ import DataFlow::PathGraph
9
9
* A model of the `SockJS` websocket data handler (https://sockjs.org).
10
10
*/
11
11
module SockJS {
12
- class SourceFromSocketJS extends RemoteFlowSource {
12
+ class SourceFromSocketJS extends RemoteFlowSource {
13
13
/**
14
- * Access to user-controlled data object received from websocket
14
+ * Access to user-controlled data object received from websocket
15
15
* For example:
16
16
* ```
17
17
* server.on('connection', function(conn) {
18
18
* conn.on('data', function(message) {
19
19
* ...
20
20
* });
21
- * });
21
+ * });
22
22
* ```
23
- */
23
+ */
24
24
SourceFromSocketJS ( ) {
25
- exists ( DataFlow:: CallNode createServer ,
26
- DataFlow:: CallNode connNode ,
27
- DataFlow:: CallNode dataHandlerNode |
28
- createServer = appCreation ( ) and
25
+ exists (
26
+ DataFlow:: CallNode createServer , DataFlow:: CallNode connNode ,
27
+ DataFlow:: CallNode dataHandlerNode
28
+ |
29
+ createServer = appCreation ( ) and
29
30
connNode = createServer .getAMethodCall ( "on" ) and
30
- connNode .getArgument ( 0 ) .getStringValue ( ) = "connection" and
31
+ connNode .getArgument ( 0 ) .getStringValue ( ) = "connection" and
31
32
dataHandlerNode = connNode .getCallback ( 1 ) .getParameter ( 0 ) .getAMethodCall ( "on" ) and
32
33
dataHandlerNode .getArgument ( 0 ) .getStringValue ( ) = "data" and
33
34
this = dataHandlerNode .getCallback ( 1 ) .getParameter ( 0 )
@@ -42,7 +43,5 @@ module SockJS {
42
43
*/
43
44
private DataFlow:: CallNode appCreation ( ) {
44
45
result = DataFlow:: moduleImport ( "sockjs" ) .getAMemberCall ( "createServer" )
45
- or
46
- result = DataFlow:: moduleMember ( "sockjs" , "createServer" )
47
46
}
48
47
}
0 commit comments