diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js index 07a16175ffcd73..ced361c8d60898 100644 --- a/lib/_stream_duplex.js +++ b/lib/_stream_duplex.js @@ -71,7 +71,20 @@ function Duplex(options) { } ObjectDefineProperties(Duplex.prototype, { - writable: ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writable'), + writable: + ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writable'), + writableHighWaterMark: + ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableHighWaterMark'), + writableBuffer: + ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableBuffer'), + writableLength: + ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableLength'), + writableFinished: + ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableFinished'), + writableCorked: + ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableCorked'), + writableEnded: + ObjectGetOwnPropertyDescriptor(Writable.prototype, 'writableEnded'), destroyed: { get() { @@ -89,41 +102,5 @@ ObjectDefineProperties(Duplex.prototype, { this._writableState.destroyed = value; } } - }, - - writableHighWaterMark: { - get() { - return this._writableState && this._writableState.highWaterMark; - } - }, - - writableBuffer: { - get() { - return this._writableState && this._writableState.getBuffer(); - } - }, - - writableLength: { - get() { - return this._writableState && this._writableState.length; - } - }, - - writableFinished: { - get() { - return this._writableState ? this._writableState.finished : false; - } - }, - - writableCorked: { - get() { - return this._writableState ? this._writableState.corked : 0; - } - }, - - writableEnded: { - get() { - return this._writableState ? this._writableState.ending : false; - } } });