// The other realm of the transfer test (WAI browser-sink §8, §9.2 step 5): a frame posted here // with its binding beside it is attached on arrival in this realm's side table; the worker // says what it holds, then posts the frame back the same way. import { SideTable, installFramePatches } from "../room/binding.js"; installFramePatches(); const table = new SideTable(); self.onmessage = (e) => { const { frame, binding } = e.data; table.transferIn(frame, binding || null); const held = SideTable.of(frame); const clone = frame.clone(); const cloned = SideTable.of(clone); clone.close(); const back = table.transferOut(frame); self.postMessage({ held: held ? held.binding : null, cloned: cloned ? cloned.binding : null, format: frame.format, frame, binding: back }, [frame]); };