-
-
Notifications
You must be signed in to change notification settings - Fork 34.7k
Closed
Description
Version
v17.0.0-rc.0
Platform
No response
Subsystem
No response
What steps will reproduce the bug?
related: #39759
According to the specification, the structuredClone options do not take a list of transfers as an array. This is different from postMessage.
https://html.spec.whatwg.org/multipage/structured-data.html#structured-cloning
https://html.spec.whatwg.org/multipage/web-messaging.html#message-ports
const value = new Uint8Array(4);
// valid
port.postMessage(value, [value.buffer]);
// valid
port.postMessage(value, { transfer: [value.buffer] });
// invalid (No transfer)
structuredClone(value, [value.buffer]);
// valid
structuredClone(value, { transfer: [value.buffer] });minimum test code:
import assert from "assert";
const value = new Uint8Array(4);
structuredClone(value, [value.buffer]);
assert( value.length !== 0 );How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
No response
What do you see instead?
No response
Additional information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels