deno/tests/specs/npm/workers/main.ts
Bartek Iwańczuk 1f02d34877
fix: remove self from global middleware (#29734)
Follow up to https://github.com/denoland/deno/pull/29543 that does
the same for `self` global. Unfortunately this omission led to a problem
described in https://github.com/denoland/deno/issues/29726 where
packages started thinking that they are being run in a web worker
context (because they are!) but the expected "self" global is not
there.
2025-06-13 12:48:26 +02:00

15 lines
433 B
TypeScript

import { Worker as WorkerThread } from "node:worker_threads";
new Worker(new URL("./worker1.ts", import.meta.url), {
type: "module",
});
new Worker(new URL("./worker2.ts", import.meta.url), {
type: "module",
});
new Worker(new URL("./worker3.ts", import.meta.url), {
type: "module",
});
new WorkerThread(new URL("./worker4.mjs", import.meta.url));
new Worker(new URL("./worker5.mjs", import.meta.url), {
type: "module",
});