2020-01-17 18:43:53 -05:00
|
|
|
let thrown = false;
|
|
|
|
|
2020-04-14 11:41:06 -04:00
|
|
|
if (self.name !== "") {
|
|
|
|
throw Error(`Bad worker name: ${self.name}, expected empty string.`);
|
2020-01-29 12:54:23 -05:00
|
|
|
}
|
|
|
|
|
2020-03-28 13:03:49 -04:00
|
|
|
onmessage = function (e) {
|
2020-01-17 18:43:53 -05:00
|
|
|
if (thrown === false) {
|
|
|
|
thrown = true;
|
|
|
|
throw new SyntaxError("[test error]");
|
|
|
|
}
|
|
|
|
|
2019-04-01 15:09:59 -04:00
|
|
|
postMessage(e.data);
|
2020-01-29 12:54:23 -05:00
|
|
|
close();
|
2019-04-01 15:09:59 -04:00
|
|
|
};
|
2020-01-17 18:43:53 -05:00
|
|
|
|
2020-03-28 13:03:49 -04:00
|
|
|
onerror = function () {
|
2020-01-17 18:43:53 -05:00
|
|
|
return false;
|
|
|
|
};
|