stream: add writableCorked to Duplex

PR-URL: https://github.com/nodejs/node/pull/29053
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
Anna Henningsen
2019-11-13 17:03:58 +00:00
parent 31ea341ab0
commit dc7b5fca3a

View File

@@ -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