zlib: remove `_closed`
Checklist
-
tests and code linting passes -
the commit message follows commit guidelines
Affected core subsystem(s)
zlib
Description of change
This is purely cleanup and carries no visible behavioural changes.
Up to now, this._closed
was used in zlib.js as a synonym of !this._handle
. This change makes this connection explicit and removes the _closed
property from zlib streams, as the previous duplication has been the cause of subtle errors like https://github.com/nodejs/node/issues/6034.
This also makes zlib errors lead to an explicit _close()
call rather than waiting for garbage collection to clean up the handle, thus returning memory resources earlier in the case of an error.