Parents: #140, #163, #164
Pinned reference: Bun 4982b91e src/jsc/bindings/Serialization.cpp; Home 7ed99c02 JSValue.zig
Implement the shared private serialization slice on top of zig-js's existing failure-atomic structured-clone wire format.
Acceptance:
- Implement exact 24-byte
{bytes,size,handle}return layout forBun__serializeJSValue. - Keep the returned byte span stable and independently owned until
Bun__SerializedScriptSlice__free. - Release retained SharedArrayBuffer manifest references and bytes exactly once; define null/stale-handle behavior safely.
- Publish DataCloneError/OOM through the VM-shared pending-exception channel and return a zero external slice.
- Implement the companion
Bun__JSValue__deserializeboundary with malformed-input diagnostics and same-VM output ownership. - Specify/test
forCrossProcessTransferandforStorageflags instead of silently ignoring unsupported semantics. - Cover primitives, cycles/identity, typed data, SharedArrayBuffer lifetime, uncloneable values, malformed bytes, cross-VM rejection, and allocation failure.
- Add compiled consumer coverage, regenerate both inventories, and update #140/#163/#164 totals.