summaryrefslogtreecommitdiff
path: root/cli/tests/subdir/test_worker.js
blob: cec5bdf9be7459e6fee059cb0d276e216688b20b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
let thrown = false;

onmessage = function(e) {
  console.log(e.data);

  if (thrown === false) {
    thrown = true;
    throw new SyntaxError("[test error]");
  }

  postMessage(e.data);

  workerClose();
};

onerror = function() {
  console.log("called onerror in worker");
  return false;
};