diff --git a/doc/api/deprecations.md b/doc/api/deprecations.md index f10265b9ddd98a..97d91123cb3849 100644 --- a/doc/api/deprecations.md +++ b/doc/api/deprecations.md @@ -2284,6 +2284,9 @@ core and obsoleted by the removal of NPN (Next Protocol Negotiation) support. -Type: Runtime +Type: End-of-Life Deprecated alias for [`zlib.bytesWritten`][]. This original name was chosen because it also made sense to interpret the value as the number of bytes diff --git a/lib/zlib.js b/lib/zlib.js index 2fb329814d3dee..6064c2e10f1905 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -47,9 +47,6 @@ const { genericNodeError, } = require('internal/errors'); const { Transform, finished } = require('stream'); -const { - deprecate, -} = require('internal/util'); const { isArrayBufferView, isAnyArrayBuffer, @@ -272,24 +269,6 @@ ObjectDefineProperty(ZlibBase.prototype, '_closed', { }, }); -// `bytesRead` made sense as a name when looking from the zlib engine's -// perspective, but it is inconsistent with all other streams exposed by Node.js -// that have this concept, where it stands for the number of bytes read -// *from* the stream (that is, net.Socket/tls.Socket & file system streams). -ObjectDefineProperty(ZlibBase.prototype, 'bytesRead', { - __proto__: null, - configurable: true, - enumerable: true, - get: deprecate(function() { - return this.bytesWritten; - }, 'zlib.bytesRead is deprecated and will change its meaning in the ' + - 'future. Use zlib.bytesWritten instead.', 'DEP0108'), - set: deprecate(function(value) { - this.bytesWritten = value; - }, 'Setting zlib.bytesRead is deprecated. ' + - 'This feature will be removed in the future.', 'DEP0108'), -}); - /** * @this ZlibBase * @returns {void}