Parent: #473 Related: #480, #493
Problem
Structured clone writes ordinary string values through canonical WTF-8, but Blob/File metadata still passes physical StringCell bytes directly to the wire writer. A non-ASCII flat-Latin-1 File name can therefore be serialized as a raw one-byte image rather than canonical WTF-8. The existing primitive/Error paths also allocate an arena transcode before copying the same bytes into the final wire buffer.
Scope
- Add one representation-aware wire-string writer for String Values.
- Borrow canonical and ASCII storage directly.
- Encode physical flat Latin-1 directly into one exactly reserved wire field without an intermediate conversion allocation.
- Route primitive strings, Error messages, Blob types, and File names through the shared path.
- Preserve WTF-8 lone surrogates, astral pairs, frame limits, failure atomicity, object identity, transfer/SAB behavior, and the versioned wire format.
No-workaround rules
- No wire-version fork, invalid byte acceptance, system transcoder, hidden second copy, lossy UTF-8 replacement, source-specific special case, or disabled frame limit.
- No stack, queue, job, Promise, Worker, or Map/Set iterator changes.
Acceptance
- Canonical, ASCII, physical flat-Latin-1, astral, and lone-surrogate strings round-trip exactly.
- File name/type metadata uses the same exact representation-aware writer.
- Flat-Latin-1 encoding reserves and fills the final wire field once with no temporary conversion allocation.
- Malformed/frame-limit, SAB/transfer, OOM, focused/full unit, TSan where applicable, and relevant Test262 gates remain exact.