console: unregister temporary error listener
PR-URL: https://github.com/nodejs/node/pull/30852 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
parent
d06efafe6b
commit
d64c1dc24a
@ -213,7 +213,7 @@ function createWriteErrorHandler(instance, streamSymbol) {
|
|||||||
// removed after the event, non-console.* writes won't be affected.
|
// removed after the event, non-console.* writes won't be affected.
|
||||||
// we are only adding noop if there is no one else listening for 'error'
|
// we are only adding noop if there is no one else listening for 'error'
|
||||||
if (stream.listenerCount('error') === 0) {
|
if (stream.listenerCount('error') === 0) {
|
||||||
stream.on('error', noop);
|
stream.once('error', noop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user