Created
July 24, 2016 18:01
-
-
Save vkurchatkin/15d731e44785dce4fe4d6b9bba0308b1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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