[x] stream: don't emit finish after destroy()
When destroying, the stream will be potentially incomplete and therefore it doesn't make sense to emit finish.
Also simplify and inline related conditions.
After destroy()
(in general) we should really only be emitting 'close'
and possibly 'error'
.
As we do in fs
the user should call end()
if they want to gracefully close/destroy a stream (https://github.com/nodejs/node/pull/15407).
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
NOTE TO SELF: do minor refactoring and cleanup after merge