From c7e55c6b72fb5a7032bc12c74329fa840076dec0 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sun, 28 Jun 2020 17:44:07 +0200 Subject: [PATCH] stream: fix writable.end callback behavior Changes so that the end() callback behaves the same way in relation to _final as write() does to _write/_writev. PR-URL: https://github.com/nodejs/node/pull/34101 Reviewed-By: Matteo Collina Reviewed-By: Anna Henningsen --- doc/api/stream.md | 11 ++-- lib/_stream_writable.js | 53 +++++++++---------- .../test-stream-transform-final-sync.js | 4 +- test/parallel/test-stream-transform-final.js | 4 +- test/parallel/test-stream-writable-destroy.js | 2 +- .../test-stream-writable-end-cb-error.js | 4 +- .../test-stream-writable-end-cb-uncaught.js | 2 +- test/parallel/test-stream-write-destroy.js | 2 +- 8 files changed, 40 insertions(+), 42 deletions(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 588e7bdfd3a7a2..003389502aeac1 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -412,6 +412,9 @@ Is `true` after [`writable.destroy()`][writable-destroy] has been called.