Skip to content

Commit

Permalink
stream: add writableCorked to Duplex
Browse files Browse the repository at this point in the history
PR-URL: #29053
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
addaleax authored and targos committed Jan 13, 2020
1 parent 6a8a33c commit 63e3a62
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/_stream_duplex.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ Object.defineProperty(Duplex.prototype, 'writableFinished', {
}
});

Object.defineProperty(Duplex.prototype, 'writableCorked', {
// Making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
// userland will fail
enumerable: false,
get() {
return this._writableState ? this._writableState.corked : 0;
}
});

Object.defineProperty(Duplex.prototype, 'writableEnded', {
// Making it explicit this property is not enumerable
// because otherwise some prototype manipulation in
Expand Down

0 comments on commit 63e3a62

Please sign in to comment.