diff options
Diffstat (limited to 'lib/_stream_transform.js')
-rw-r--r-- | lib/_stream_transform.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js index 222b1390f8..013bebde2a 100644 --- a/lib/_stream_transform.js +++ b/lib/_stream_transform.js @@ -155,10 +155,11 @@ Transform.prototype._transform = function(chunk, output, cb) { throw new Error('not implemented'); }; -Transform.prototype._write = function(chunk, cb) { +Transform.prototype._write = function(chunk, encoding, cb) { var ts = this._transformState; ts.writecb = cb; ts.writechunk = chunk; + ts.writeencoding = encoding; if (!ts.transforming) { var rs = this._readableState; if (ts.needTransform || @@ -176,7 +177,7 @@ Transform.prototype._read = function(n) { if (ts.writechunk && ts.writecb && !ts.transforming) { ts.transforming = true; - this._transform(ts.writechunk, ts.afterTransform); + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); } else { // mark that we need a transform, so that any data that comes in // will get processed, now that we've asked for it. |