From d02651c9d60502a8f60f8cc2d3bd53b27851bf25 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 8dc865a76d4c32..ede9c3efd225cd 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.