summaryrefslogtreecommitdiff
path: root/node_modules/webworker-threads/test/test09_throw_from_the_callback.js
blob: b5beddc9f635142dac06c3c40095f50523c32025 (plain)
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!');
})