0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

streams2: Convert strings to buffers before passing to _write()

This commit is contained in:
isaacs 2012-10-02 16:28:02 -07:00
parent 420e07c577
commit 639fbe28d1

View File

@ -65,7 +65,7 @@ Writable.prototype.write = function(chunk, encoding) {
return;
}
if (typeof chunk === 'string' && encoding)
if (typeof chunk === 'string')
chunk = new Buffer(chunk, encoding);
var ret = state.length >= state.highWaterMark;