Skip to content

Commit

Permalink
stream: micro-optimize writable condition
Browse files Browse the repository at this point in the history
PR-URL: #53189
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
orgads authored and RafaelGSS committed Jun 7, 2024
1 parent 1d59345 commit 7c66b27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/streams/writable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7c66b27

Please sign in to comment.