I believe the events allowed to be emitted after error should be rather limited.
Based on the test suite I've found the following exceptions:
exit, disconnect and close, should be ok.unpipe, maybe ok?
I've fixed some:
#28709
#28708
#28711
Then there are a lot of possible cases that might need fixing:
https://gist.github.com/ronag/b5728ae5db305abaff9955da5b47a5c9
I've found these by updating EventEmitter.prototype.emit with:
if(this._emittedError){if(!['close','exit','disconnect'].includes(type)){thrownewError("unexpected event: "+type);}}elseif(type==='error'){this._emittedError=true;}Is this worth to further look into?
I believe the events allowed to be emitted after
errorshould be rather limited.Based on the test suite I've found the following exceptions:
exit,disconnectandclose, should be ok.unpipe, maybe ok?I've fixed some:
#28709
#28708
#28711
Then there are a lot of possible cases that might need fixing:
https://gist.github.com/ronag/b5728ae5db305abaff9955da5b47a5c9
I've found these by updating
EventEmitter.prototype.emitwith:Is this worth to further look into?