1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
var Thread= require('webworker-threads'); function cb (e,m) { console.log([e,m]); this.destroy(); throw('An error'); } Thread.create().eval('0', cb); process.on('uncaughtException', function () { console.log('OK, BYE!'); })