From 8105984d9e03bc34c49f8029f30ee76c3cd4d24f Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Mon, 25 Mar 2019 12:34:36 +0100 Subject: [PATCH] process: remove protection for SyncWriteStream destroy in stdio https://github.com/nodejs/node/pull/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: https://github.com/nodejs/node/pull/26691 --- lib/internal/process/stdio.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/internal/process/stdio.js b/lib/internal/process/stdio.js index 46c2ba4e9ca35d..385225cabc402e 100644 --- a/lib/internal/process/stdio.js +++ b/lib/internal/process/stdio.js @@ -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