summaryrefslogtreecommitdiff
path: root/lib/_stream_duplex.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/_stream_duplex.js')
-rw-r--r--lib/_stream_duplex.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js
index 49520c4074..d20877e921 100644
--- a/lib/_stream_duplex.js
+++ b/lib/_stream_duplex.js
@@ -98,6 +98,16 @@ Object.defineProperty(Duplex.prototype, 'writableLength', {
}
});
+Object.defineProperty(Duplex.prototype, 'writableFinished', {
+ // Making it explicit this property is not enumerable
+ // because otherwise some prototype manipulation in
+ // userland will fail
+ enumerable: false,
+ get() {
+ return this._writableState.finished;
+ }
+});
+
// The no-half-open enforcer
function onend() {
// If the writable side ended, then we're ok.