Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /streams/transferable/transform-stream-members.any.html - WPT Dashboard Interop Dashboard
- /streams/transferable/transform-stream-members.any.shadowrealm-in-dedicatedworker.html - WPT Dashboard Interop Dashboard
- /streams/transferable/transform-stream-members.any.shadowrealm-in-shadowrealm.html - WPT Dashboard Interop Dashboard
- /streams/transferable/transform-stream-members.any.shadowrealm-in-sharedworker.html - WPT Dashboard Interop Dashboard
- /streams/transferable/transform-stream-members.any.shadowrealm-in-window.html - WPT Dashboard Interop Dashboard
- /streams/transferable/transform-stream-members.any.worker.html - WPT Dashboard Interop Dashboard
- /streams/transferable/transform-stream-members.https.any.shadowrealm-in-audioworklet.html - WPT Dashboard Interop Dashboard
- /streams/transferable/transform-stream-members.https.any.shadowrealm-in-serviceworker.html - WPT Dashboard Interop Dashboard
// META: global=window,dedicatedworker,shadowrealm
const combinations = [
(t => [t, t.readable])(new TransformStream()),
(t => [t.readable, t])(new TransformStream()),
(t => [t, t.writable])(new TransformStream()),
(t => [t.writable, t])(new TransformStream()),
];
for (const combination of combinations) {
test(() => {
assert_throws_dom(
"DataCloneError",
() => structuredClone(combination, { transfer: combination }),
"structuredClone should throw"
);
}, `Transferring ${combination} should fail`);
}