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 {
946946 ImportedNodeJSEventEmitter ( ) { this = getAnEventEmitterImport ( ) .getAnInstantiation ( ) }
947947 }
948948
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+
949958 /**
950959 * A class that extends EventEmitter.
951960 */
Original file line number Diff line number Diff line change 1212| tst.js:28:17:28:22 | "blab" | tst.js:25:16:25:20 | event |
1313| tst.js:34:18:34:22 | "BOH" | tst.js:33:17:33:17 | x |
1414| 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{}
3737
3838var em5 = new ExtendsMyCustomEmitter ( ) ;
3939em5 . 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