Skip to content

Commit

Permalink
process: remove protection for SyncWriteStream destroy in stdio
Browse files Browse the repository at this point in the history
#26691 introduced an if to protect
against SyncWriteStream not using the default .destroy() mechanism.
This change removes that as SyncWriteStream now use standard .destroy().

See: #26691

PR-URL: #26902
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
mcollina committed Mar 28, 2019
1 parent 4bfc06f commit d4eda4d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/internal/process/stdio.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
exports.getMainThreadStdio = getMainThreadStdio;

function dummyDestroy(err, cb) {
// SyncWriteStream does not use the stream
// destroy mechanism for some legacy reason.
// TODO(mcollina): remove when
// https://github.com/nodejs/node/pull/26690 lands.
if (typeof cb === 'function') {
cb(err);
}
cb(err);

// We need to emit 'close' anyway so that the closing
// of the stream is observable. We just make sure we
Expand Down

0 comments on commit d4eda4d

Please sign in to comment.