mirror of
https://github.com/denoland/deno.git
synced 2025-09-22 18:32:28 +00:00

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.
15 lines
433 B
TypeScript
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",
|
|
});
|