mirror of
https://github.com/denoland/deno.git
synced 2024-12-28 18:19:08 -05:00
4786e1d92d
The panic was caused by the lack of an error class mapping for futures::channel::TrySendError, but it shouldn't have been throwing an error in the first place - when a worker has terminated, postMessage should just return. The issue was that the termination message hadn't yet been recieved, so it was carrying on with trying to send the message. This adds another check on the Rust side for if the channel is closed, and if it is the worker is treated as terminated.
5 lines
120 B
TypeScript
5 lines
120 B
TypeScript
const w = new Worker(new URL("doesnt_exist.js", import.meta.url).href, {
|
|
type: "module",
|
|
});
|
|
|
|
w.postMessage("hello");
|