summaryrefslogtreecommitdiff
path: root/lib/_stream_duplex.js
diff options
context:
space:
mode:
authorMathias Buus <mathiasbuus@gmail.com>2018-01-29 19:32:34 +0100
committerMatteo Collina <hello@matteocollina.com>2018-03-06 13:31:56 +0100
commit5e3f51648ed5de36b01d53bde13fb6fb7b965667 (patch)
treea134fb92b8b846e195ea3f960131fcc9147533e6 /lib/_stream_duplex.js
parentacac0f852a02c2b129adbc51e0bd8bd482d791af (diff)
downloadandroid-node-v8-5e3f51648ed5de36b01d53bde13fb6fb7b965667.tar.gz
android-node-v8-5e3f51648ed5de36b01d53bde13fb6fb7b965667.tar.bz2
android-node-v8-5e3f51648ed5de36b01d53bde13fb6fb7b965667.zip
stream: updated streams error handling
This improves error handling for streams in a few ways. 1. It ensures that no user defined methods (_read, _write, ...) are run after .destroy has been called. 2. It introduces an explicit error to tell the user if they are write to write, etc to the stream after it has been destroyed. 3. It makes streams always emit close as the last thing after they have been destroyed 4. Changes the default _destroy to not gracefully end streams. It also updates net, http2, zlib and fs to the new error handling. PR-URL: https://github.com/nodejs/node/pull/18438 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'lib/_stream_duplex.js')
-rw-r--r--lib/_stream_duplex.js7
1 files changed, 0 insertions, 7 deletions
diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js
index 59ce832927..1ccb931260 100644
--- a/lib/_stream_duplex.js
+++ b/lib/_stream_duplex.js
@@ -135,10 +135,3 @@ Object.defineProperty(Duplex.prototype, 'destroyed', {
this._writableState.destroyed = value;
}
});
-
-Duplex.prototype._destroy = function(err, cb) {
- this.push(null);
- this.end();
-
- process.nextTick(cb, err);
-};