mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
Readable.push and Writable.write with a union chunk (Buffer, string and null arms) read the chunk's tag and payload from a tagged union box. A union with one reference arm and null, such as `string | null` or `Buffer | null`, is the arm pointer itself, so `push(line)` with `line: string | null` and `push(done ? null : text)` read past the string and crashed. Both now read the tag and payload with unionTag and unionPeek, as the other union consumers do. unshift and end refuse union chunks and are unchanged.