stream: add writableAborted · nodejs/node@415726b · GitHub
Skip to content

Commit 415726b

Browse files
committed
stream: add writableAborted
PR-URL: #40802 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent aa394ab commit 415726b

3 files changed

Lines changed: 49 additions & 0 deletions

File tree

doc/api/stream.md

Lines changed: 12 additions & 0 deletions

lib/internal/streams/writable.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,6 +864,17 @@ ObjectDefineProperties(Writable.prototype, {
864864
return this._writableState ? this._writableState.errored : null;
865865
}
866866
},
867+
868+
writableAborted: {
869+
enumerable: false,
870+
get: function() {
871+
return !!(
872+
this._writableState.writable !== false &&
873+
(this._writableState.destroyed || this._writableState.errored) &&
874+
!this._writableState.finished
875+
);
876+
}
877+
},
867878
});
868879

869880
const destroy = destroyImpl.destroy;
Lines changed: 26 additions & 0 deletions

0 commit comments

Comments
 (0)