From c5c4a534d13d73ff947c1948176a5cfb9937f42d Mon Sep 17 00:00:00 2001 From: Calvin Metcalf Date: Fri, 5 May 2017 14:42:21 +0200 Subject: [PATCH] stream: rm {writeable/readable}State.length As part of the readableState/writableState mega issue #445, this removes all of the references to .length on those properties and replaces them with a readableLength and writableLength getter. See: https://github.com/nodejs/node/issues/445 PR-URL: https://github.com/nodejs/node/pull/12857 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Jeremiah Senkpiel Reviewed-By: Ruben Bridgewater Reviewed-By: Matteo Collina --- doc/api/stream.md | 19 ++++++++++++++++++- lib/_stream_duplex.js | 16 +++++++++++++++- lib/_stream_readable.js | 14 ++++++++++++++ lib/_stream_writable.js | 13 +++++++++++++ lib/_tls_legacy.js | 2 +- lib/_tls_wrap.js | 2 +- lib/net.js | 6 +++--- test/parallel/test-https-truncate.js | 2 +- .../test-stream-readable-flow-recursion.js | 2 +- test/parallel/test-stream2-push.js | 2 +- test/parallel/test-stream2-read-sync-stack.js | 4 ++-- test/parallel/test-stream2-transform.js | 2 +- test/parallel/test-stream2-unpipe-leak.js | 2 +- test/parallel/test-stream2-writable.js | 2 +- test/pummel/test-https-no-reader.js | 2 +- test/pummel/test-net-throttle.js | 2 +- 16 files changed, 75 insertions(+), 17 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index dc74df7720ee19..741f10546426d6 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -441,10 +441,18 @@ See also: [`writable.cork()`][]. - Return the value of `highWaterMark` passed when constructing this `Writable`. +##### writable.writableLength + + +This property contains the number of bytes (or objects) in the queue +ready to be written. The value provides introspection data regarding +the status of the `highWaterMark`. + ##### writable.write(chunk[, encoding][, callback]) + +This property contains the number of bytes (or objects) in the queue +ready to be read. The value provides introspection data regarding +the status of the `highWaterMark`. + ##### readable.resume()