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 MylesBorins committed Nov 17, 2019
1 parent 642b0b8 commit 41720d7
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 41720d7

Please sign in to comment.