1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-04 08:54:20 -05:00
denoland-deno/cli/tests/subdir/nested_worker.js

19 lines
367 B
JavaScript
Raw Normal View History

// Specifier should be resolved relative to current file
const jsWorker = new Worker("./sibling_worker.js", {
type: "module",
name: "sibling",
});
jsWorker.onerror = (_e) => {
postMessage({ type: "error" });
};
jsWorker.onmessage = (e) => {
postMessage({ type: "msg", text: e });
close();
};
onmessage = function (e) {
jsWorker.postMessage(e.data);
};