mirror of
https://github.com/github/codeql.git
synced 2026-05-04 05:05:12 +02:00
Merge pull request #2969 from esbena/js/process-as-event-emitter
Approved by erik-krogh
This commit is contained in:
@@ -946,6 +946,15 @@ module NodeJSLib {
|
||||
ImportedNodeJSEventEmitter() { this = getAnEventEmitterImport().getAnInstantiation() }
|
||||
}
|
||||
|
||||
/**
|
||||
* The NodeJS `process` object as an EventEmitter subclass.
|
||||
*/
|
||||
private class ProcessAsNodeJSEventEmitter extends NodeJSEventEmitter {
|
||||
ProcessAsNodeJSEventEmitter() {
|
||||
this = process()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A class that extends EventEmitter.
|
||||
*/
|
||||
|
||||
@@ -12,3 +12,5 @@
|
||||
| tst.js:28:17:28:22 | "blab" | tst.js:25:16:25:20 | event |
|
||||
| tst.js:34:18:34:22 | "BOH" | tst.js:33:17:33:17 | x |
|
||||
| tst.js:40:20:40:27 | "yabity" | tst.js:39:19:39:19 | x |
|
||||
| tst.js:46:28:46:38 | 'FirstData' | tst.js:43:45:43:49 | first |
|
||||
| tst.js:47:29:47:40 | 'SecondData' | tst.js:44:37:44:42 | second |
|
||||
|
||||
@@ -37,4 +37,11 @@ class ExtendsMyCustomEmitter extends MyEventEmitter{}
|
||||
|
||||
var em5 = new ExtendsMyCustomEmitter();
|
||||
em5.on("yibity", (x) => {});
|
||||
em5.emit("yibity", "yabity");
|
||||
em5.emit("yibity", "yabity");
|
||||
|
||||
var process = require('process');
|
||||
process.addListener('FirstEvent', function (first) {});
|
||||
process.on('SecondEvent', function (second) {});
|
||||
|
||||
process.emit('FirstEvent', 'FirstData');
|
||||
process.emit('SecondEvent', 'SecondData');
|
||||
|
||||
Reference in New Issue
Block a user