Writable currently inherits from Stream without any visible benefit. Stream only exposes pipe() which Writable's own prototype replaces. Would it not be beneficial to make Writable inherit straight from EventEmitter? That way, all EE related API would not need to go one level deeper into the prototype chain, and its constructor would speed up a bit.
I'm asking for feedback, because I'm not sure about drawbacks, or how Duplex may ruin this idea. The only thing that this will break is myWritable instanceof Stream tests. That is BC breakage, but the effects should be very limited I imagine. Also, it doesn't seem to happen anywhere in Node itself.
Writablecurrently inherits fromStreamwithout any visible benefit. Stream only exposespipe()which Writable's own prototype replaces. Would it not be beneficial to make Writable inherit straight from EventEmitter? That way, all EE related API would not need to go one level deeper into the prototype chain, and its constructor would speed up a bit.I'm asking for feedback, because I'm not sure about drawbacks, or how Duplex may ruin this idea. The only thing that this will break is
myWritable instanceof Streamtests. That is BC breakage, but the effects should be very limited I imagine. Also, it doesn't seem to happen anywhere in Node itself.