Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vkurchatkin/15d731e44785dce4fe4d6b9bba0308b1 to your computer and use it in GitHub Desktop.
Save vkurchatkin/15d731e44785dce4fe4d6b9bba0308b1 to your computer and use it in GitHub Desktop.
'use strict';
const stream = require('stream');
class A extends stream.Readable {
_read() {
}
}
class B extends stream.Writable {
_write(buf, _ , cb) {
}
}
const a = new A();
const b = new B();
b.on('unpipe', () => {
console.log('unpipe');
});
b.on('error', () => {});
a.pipe(b);
b.prependListener('error', () => {
process.once('uncaughtException', () => {
console.log('no unpipe');
});
throw new Error;
});
b.emit('error', new Error);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment