mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
node: set process._eventsCount to 0 on startup
process is an EventEmitter. There are operations that increment and decrement the _eventsCount property of an EventEmitter. process._eventsCount would previously get set to NaN. This change makes process._eventsCount be calculated as expected. PR-URL: https://github.com/nodejs/node/pull/5208 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
1 parent
127dd6275a
commit
9cee86e3e9
2 files changed
+3
No files matched your search
@@ -12,6 +12,7 @@
|
||||
|
||||
function startup() {
|
||||
var EventEmitter = NativeModule.require('events');
|
||||
process._eventsCount = 0;
|
||||
|
||||
Object.setPrototypeOf(process, Object.create(EventEmitter.prototype, {
|
||||
constructor: {
|
||||
|
||||
@@ -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);
|
||||
Reference in new issue
Block a user