mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
A stream's "data" payload arrives as checked-dynamic, and decoder.write/ decoder.end fenced it (SC2020 'StringDecoder.write of 'unknown' data'). The dyn route reads the chunk as Node does: a string returns unchanged without touching the buffered state, an ArrayBufferView (Buffer, TypedArray, DataView) decodes through the existing per-encoding helpers with the packed-f64 pending state threaded through, and anything else throws ERR_INVALID_ARG_TYPE for "buf" with Node's message. The two runtime entries live in scr_bytes.c beside their static twins and share the same `StringDecoder.write`/`end` lowering, so a program that only ever passes typed chunks keeps the existing libCalls (zero-cost). Corpus 8428 pins the string pass-through, the utf8/base64 state across an interleaved string chunk, and both argument-type errors against Node. This commit also carries this wave's compatibility evidence: the fs, url and string_decoder corpus programs are recorded in static-support.json and the ledger is regenerated with pnpm node-compat --local. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>