From 7c66b274077415dbaec1fe8c9a32768ac1e5bfa3 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Tue, 4 Jun 2024 12:47:35 +0300 Subject: [PATCH] stream: micro-optimize writable condition PR-URL: https://github.com/nodejs/node/pull/53189 Reviewed-By: Robert Nagy Reviewed-By: Benjamin Gruenbaum Reviewed-By: Matteo Collina --- lib/internal/streams/writable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/internal/streams/writable.js b/lib/internal/streams/writable.js index 38f1cbadd39d1d..9f6fa4936dca62 100644 --- a/lib/internal/streams/writable.js +++ b/lib/internal/streams/writable.js @@ -1005,8 +1005,8 @@ ObjectDefineProperties(Writable.prototype, { // where the writable side was disabled upon construction. // Compat. The user might manually disable writable side through // deprecated setter. - return !!w && w.writable !== false && !w.errored && - (w[kState] & (kEnding | kEnded | kDestroyed)) === 0; + return !!w && w.writable !== false && + (w[kState] & (kEnding | kEnded | kDestroyed | kErrored)) === 0; }, set(val) { // Backwards compatible.