We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6199441 commit 3d11bafCopy full SHA for 3d11baf
lib/internal/structured_clone.js
@@ -6,13 +6,13 @@ const {
6
} = require('internal/worker/io');
7
8
let channel;
9
-function structuredClone(value, transfer) {
+function structuredClone(value, options = undefined) {
10
// TODO: Improve this with a more efficient solution that avoids
11
// instantiating a MessageChannel
12
channel ??= new MessageChannel();
13
channel.port1.unref();
14
channel.port2.unref();
15
- channel.port1.postMessage(value, transfer);
+ channel.port1.postMessage(value, options?.transfer);
16
return receiveMessageOnPort(channel.port2).message;
17
}
18
0 commit comments