forked from mirrors/gecko-dev
Status checks are done in batch before any transfer, but transferring streams can change the status of parent/child of TransformStream and cause an assertion failure. Differential Revision: https://phabricator.services.mozilla.com/D170897
16 lines
491 B
JavaScript
16 lines
491 B
JavaScript
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`);
|
|
}
|