Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ npm install --save readable-stream
This package is a mirror of the Streams2 and Streams3 implementations in
Node-core.

Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v7.7.3/docs/api/).
Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v7.8.0/docs/api/).

If you want to guarantee a stable streams base, regardless of what version of
Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
Expand Down
7 changes: 7 additions & 0 deletions build/test-replacements.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,3 +304,10 @@ module.exports['test-stream-buffer-list.js'] = [
'require(\'../../lib/internal/streams/BufferList\');'
]
]

module.exports['test-stream-transform-constructor-set-methods.js'] = [
[
/Error: _transform\\\(\\\) is n/,
'Error: .*[Nn]'
]
]
9 changes: 5 additions & 4 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ var StringDecoder;

util.inherits(Readable, Stream);

var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];

function prependListener(emitter, event, fn) {
// Sadly this is not cacheable as some libraries bundle their own
// event emitter implementation with them.
Expand Down Expand Up @@ -784,10 +786,9 @@ Readable.prototype.wrap = function (stream) {
}

// proxy certain important events.
var events = ['error', 'close', 'destroy', 'pause', 'resume'];
forEach(events, function (ev) {
stream.on(ev, self.emit.bind(self, ev));
});
for (var n = 0; n < kProxyEvents.length; n++) {
stream.on(kProxyEvents[n], self.emit.bind(self, kProxyEvents[n]));
}

// when we try to consume some more bytes, simply unpause the
// underlying stream.
Expand Down
20 changes: 0 additions & 20 deletions test/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,26 +257,6 @@ exports.ddCommand = function (filename, kilobytes) {
}
};

exports.spawnCat = function (options) {
var spawn = require('child_process').spawn;

if (exports.isWindows) {
return spawn('more', [], options);
} else {
return spawn('cat', [], options);
}
};

exports.spawnSyncCat = function (options) {
var spawnSync = require('child_process').spawnSync;

if (exports.isWindows) {
return spawnSync('more', [], options);
} else {
return spawnSync('cat', [], options);
}
};

exports.spawnPwd = function (options) {
var spawn = require('child_process').spawn;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ t.resume();

assert.throws(function () {
t2.end(bufferShim.from('blerg'));
}, /^Error: _transform\(\) is not implemented$/);
}, /^Error: .*[Nn]ot implemented$/);

process.on('exit', function () {
assert.strictEqual(t._transform, _transform);
Expand Down