Problem
The JS fallback structuredClone special-cases only ArrayBuffer, so a SharedArrayBuffer falls through and becomes {}; typed arrays over one break and there's no transfer option. The fallback BroadcastChannel only works within a single context. node/util.zig panics in isSharedArrayBuffer.
Evidence (origin/main @ d4b219507)
packages/runtime/src/jsc/misc_globals.zig:174-213packages/runtime/src/jsc/misc_globals.zig:214-240packages/runtime/src/node/util.zig:605-607
Scope
- Clone preserves SAB identity (same backing memory) or throws
DataCloneError; supporttransfer. BroadcastChannelfails loudly where cross-context delivery is unsupported.- Implement
util.types.isSharedArrayBufferwithout panicking.
Acceptance criteria
- In the
HOME_NATIVE_RUNrealm,structuredClone(sab)shares memory (or throwsDataCloneError); tests cover typed arrays over SAB.
Links
Part of #814.