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 <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
  • Loading branch information
orgads authored and marco-ippolito committed Jul 19, 2024
1 parent 09e2191 commit d02651c
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 d02651c

Please sign in to comment.