-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
For some reason when an error is emitted on stream in node 8 this is propagated correctly and followed by end event, however on node 10, this happens in reverse order. (using latest 2.0.1 version of pumpify)
Example:
'use strict';
const { PassThrough, Writable } = require('stream');
const pumpify = require('pumpify');
const stream1 = new PassThrough();
const stream2 = new Writable();
const combined = pumpify(stream1, stream2);
combined.on('end', () => {
console.log('Stream end');
});
combined.on('error', e => {
console.log('Stream error: ', e);
});
stream1.emit('error', 'aaa');nvm use 8
Now using node v8.17.0 (npm v6.13.4)
node tmp.js
Stream error: aaa
Stream endnvm use 10
Now using node v10.19.0 (npm v6.13.4)
node tmp.js
Stream end
Stream error: aaaNotice the reverse order of events.
Is this expected behaviour? Am I doing something wrong?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels