diff --git a/src/node.js b/src/node.js index ec0e6bf630..2912188cb1 100644 --- a/src/node.js +++ b/src/node.js @@ -12,6 +12,7 @@ function startup() { var EventEmitter = NativeModule.require('events'); + process._eventsCount = 0; Object.setPrototypeOf(process, Object.create(EventEmitter.prototype, { constructor: { diff --git a/test/parallel/test-process-emit.js b/test/parallel/test-process-emit.js index ce7d441655..f4f6d546f1 100644 --- a/test/parallel/test-process-emit.js +++ b/test/parallel/test-process-emit.js @@ -18,3 +18,5 @@ process.on('SIGPIPE', common.mustCall((data) => { process.emit('normal', 'normalData'); process.emit(sym, 'symbolData'); process.emit('SIGPIPE', 'signalData'); + +assert.strictEqual(isNaN(process._eventsCount), false);