2020-01-18 00:43:53 +01:00
|
|
|
let thrown = false;
|
|
|
|
|
2020-04-14 17:41:06 +02:00
|
|
|
if (self.name !== "") {
|
|
|
|
throw Error(`Bad worker name: ${self.name}, expected empty string.`);
|
2020-01-29 18:54:23 +01:00
|
|
|
}
|
|
|
|
|
2020-03-29 04:03:49 +11:00
|
|
|
onmessage = function (e) {
|
2020-01-18 00:43:53 +01: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 18:54:23 +01:00
|
|
|
close();
|
2019-04-01 15:09:59 -04:00
|
|
|
};
|
2020-01-18 00:43:53 +01:00
|
|
|
|
2020-03-29 04:03:49 +11:00
|
|
|
onerror = function () {
|
2020-01-18 00:43:53 +01:00
|
|
|
return false;
|
|
|
|
};
|