Affected URL(s)
https://nodejs.org/api/worker_threads.html#considerations-when-cloning-objects-with-prototypes-classes-and-accessors
Description of the problem
The following code is supposed to print {}:
const{ port1, port2 }=newMessageChannel();port1.onmessage=({ data })=>console.log(data);port2.postMessage(newURL('https://example.org'));// Prints: { } However, when running it, it gives the following:
node:internal/per_context/domexception:76
const self = new Error();
^
DOMException [DataCloneError]: Cannot clone object of unsupported type.
at new DOMException (node:internal/per_context/domexception:76:18)
at file:///my-folder-structure/test.mjs:6:7
at ModuleJob.run (node:internal/modules/esm/module_job:377:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:691:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:101:5)
Affected URL(s)
https://nodejs.org/api/worker_threads.html#considerations-when-cloning-objects-with-prototypes-classes-and-accessors
Description of the problem
The following code is supposed to print
{}:However, when running it, it gives the following: