mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
1 parent
b0f6789a78
commit
a978bedee7
2 files changed
+70
No files matched your search
@@ -98,11 +98,15 @@ function Readable(options) {
|
||||
// write() some more.
|
||||
Readable.prototype.push = function(chunk) {
|
||||
var state = this._readableState;
|
||||
if (typeof chunk === 'string' && !state.objectMode)
|
||||
chunk = new Buffer(chunk, arguments[1]);
|
||||
return readableAddChunk(this, state, chunk, false);
|
||||
};
|
||||
|
||||
Readable.prototype.unshift = function(chunk) {
|
||||
var state = this._readableState;
|
||||
if (typeof chunk === 'string' && !state.objectMode)
|
||||
chunk = new Buffer(chunk, arguments[1]);
|
||||
return readableAddChunk(this, state, chunk, true);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user