mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-08 08:44:37 +08:00
A shared view written to stdout or stderr went out in 64 KiB pieces through scr_stdio_write, so a replaced process.stdout.write received the first piece alone, and a false return, which only reports backpressure, ended the loop: a view larger than 64 KiB lost the rest. With a write hook, the view is now copied whole and passed in one call, as Node passes it; the bounded pieces go to the stream itself through scr_stdio_write_raw, which never stops early. tests/corpus/shared-bytes-stdio-write.ts replaces process.stdout.write with a function that records each chunk's length and returns false, and writes a 150,000-byte shared view through it.