blob: 76e793423005d7f5751381ff21331fab657460b0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
"use strict";
self.addEventListener("message", function onMessage(event) {
const { type, message } = event.data;
switch (type) {
case "log":
console.log(message);
break;
case "error":
throw new Error(message);
}
});
|