| 4100 | } |
| 4101 | |
| 4102 | function Writable(options) { |
| 4103 | var Duplex = require('./_stream_duplex'); |
| 4104 | |
| 4105 | // Writable ctor is applied to Duplexes, though they're not |
| 4106 | // instanceof Writable, they're instanceof Readable. |
| 4107 | if (!(this instanceof Writable) && !(this instanceof Duplex)) |
| 4108 | return new Writable(options); |
| 4109 | |
| 4110 | this._writableState = new WritableState(options, this); |
| 4111 | |
| 4112 | // legacy. |
| 4113 | this.writable = true; |
| 4114 | |
| 4115 | Stream.call(this); |
| 4116 | } |
| 4117 | |
| 4118 | // Otherwise people can pipe Writable streams, which is just wrong. |
| 4119 | Writable.prototype.pipe = function() { |