|
@ -27,6 +27,7 @@ module.exports = Writable |
|
|
|
|
|
|
|
|
var util = require('util'); |
|
|
var util = require('util'); |
|
|
var Stream = require('stream'); |
|
|
var Stream = require('stream'); |
|
|
|
|
|
var Duplex = Stream.Duplex; |
|
|
|
|
|
|
|
|
util.inherits(Writable, Stream); |
|
|
util.inherits(Writable, Stream); |
|
|
|
|
|
|
|
@ -51,6 +52,11 @@ function WritableState(options) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function Writable(options) { |
|
|
function Writable(options) { |
|
|
|
|
|
// Writable ctor is applied to Duplexes, though they're not
|
|
|
|
|
|
// instanceof Writable, they're instanceof Readable.
|
|
|
|
|
|
if (!(this instanceof Writable) && !(this instanceof Duplex)) |
|
|
|
|
|
return new Writable(options); |
|
|
|
|
|
|
|
|
this._writableState = new WritableState(options); |
|
|
this._writableState = new WritableState(options); |
|
|
|
|
|
|
|
|
// legacy.
|
|
|
// legacy.
|
|
|