Skip to content

Commit 3d11baf

Browse files
VoltrexKeyvanodejs-github-bot
authored andcommitted
lib: make structuredClone spec compliant
Fixes: #40246 PR-URL: #40251 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 6199441 commit 3d11baf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/structured_clone.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ const {
66
} = require('internal/worker/io');
77

88
let channel;
9-
function structuredClone(value, transfer) {
9+
function structuredClone(value, options = undefined) {
1010
// TODO: Improve this with a more efficient solution that avoids
1111
// instantiating a MessageChannel
1212
channel ??= new MessageChannel();
1313
channel.port1.unref();
1414
channel.port2.unref();
15-
channel.port1.postMessage(value, transfer);
15+
channel.port1.postMessage(value, options?.transfer);
1616
return receiveMessageOnPort(channel.port2).message;
1717
}
1818

0 commit comments

Comments
 (0)