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 BethGriggs committed Feb 6, 2020
1 parent af960d7 commit 55ca3a8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/_stream_duplex.js
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 55ca3a8

Please sign in to comment.