mirror of
https://github.com/denoland/deno.git
synced 2024-12-30 11:16:38 -05:00
2fa0096821
Adds another callback to WebWorkerOptions that allows to execute some modules before actual worker code executes. This allows to set up Node global using std/node.
9 lines
185 B
JavaScript
9 lines
185 B
JavaScript
console.log("hello from worker");
|
|
|
|
self.onmessage = (e) => {
|
|
if (e.data != "hello") {
|
|
throw new Error("wrong message");
|
|
}
|
|
|
|
self.postMessage({ pid: process.pid });
|
|
}
|