summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
author陈刚 <chengang07@meituan.com>2018-01-14 23:34:18 +0800
committerRod Vagg <rod@vagg.org>2018-08-16 11:38:49 +1000
commitaf27768df45776e81c94acc68c4d6ad9e5a041e6 (patch)
tree70500c50733f356317261413653dacaaf8899458 /lib
parentab967b725e5c8cb9a7454372a2422a45dac49dfb (diff)
downloadnode-new-af27768df45776e81c94acc68c4d6ad9e5a041e6.tar.gz
stream: delete redundant code
In `Writable.prototype.end()`, `state.ending` is true after calling `endWritable()` and it doesn't reset to false. In `Writable.prototype.uncork()`, `state.finished` must be false if `state.bufferedRequest` is true. PR-URL: https://github.com/nodejs/node/pull/18145 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/_stream_writable.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js
index ca7d0bd275..3e6de8fee2 100644
--- a/lib/_stream_writable.js
+++ b/lib/_stream_writable.js
@@ -307,7 +307,6 @@ Writable.prototype.uncork = function() {
if (!state.writing &&
!state.corked &&
- !state.finished &&
!state.bufferProcessing &&
state.bufferedRequest)
clearBuffer(this, state);
@@ -569,7 +568,7 @@ Writable.prototype.end = function(chunk, encoding, cb) {
}
// ignore unnecessary end() calls.
- if (!state.ending && !state.finished)
+ if (!state.ending)
endWritable(this, state, cb);
};