File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
src/semmle/javascript/frameworks
test/library-tests/frameworks/EventEmitter Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -946,6 +946,15 @@ module NodeJSLib {
946
946
ImportedNodeJSEventEmitter ( ) { this = getAnEventEmitterImport ( ) .getAnInstantiation ( ) }
947
947
}
948
948
949
+ /**
950
+ * The NodeJS `process` object as an EventEmitter subclass.
951
+ */
952
+ private class ProcessAsNodeJSEventEmitter extends NodeJSEventEmitter {
953
+ ProcessAsNodeJSEventEmitter ( ) {
954
+ this = process ( )
955
+ }
956
+ }
957
+
949
958
/**
950
959
* A class that extends EventEmitter.
951
960
*/
Original file line number Diff line number Diff line change 12
12
| tst.js:28:17:28:22 | "blab" | tst.js:25:16:25:20 | event |
13
13
| tst.js:34:18:34:22 | "BOH" | tst.js:33:17:33:17 | x |
14
14
| tst.js:40:20:40:27 | "yabity" | tst.js:39:19:39:19 | x |
15
+ | tst.js:46:28:46:38 | 'FirstData' | tst.js:43:45:43:49 | first |
16
+ | tst.js:47:29:47:40 | 'SecondData' | tst.js:44:37:44:42 | second |
Original file line number Diff line number Diff line change @@ -37,4 +37,11 @@ class ExtendsMyCustomEmitter extends MyEventEmitter{}
37
37
38
38
var em5 = new ExtendsMyCustomEmitter ( ) ;
39
39
em5 . on ( "yibity" , ( x ) => { } ) ;
40
- em5 . emit ( "yibity" , "yabity" ) ;
40
+ em5 . emit ( "yibity" , "yabity" ) ;
41
+
42
+ var process = require ( 'process' ) ;
43
+ process . addListener ( 'FirstEvent' , function ( first ) { } ) ;
44
+ process . on ( 'SecondEvent' , function ( second ) { } ) ;
45
+
46
+ process . emit ( 'FirstEvent' , 'FirstData' ) ;
47
+ process . emit ( 'SecondEvent' , 'SecondData' ) ;
You can’t perform that action at this time.
0 commit comments