Files
scriptc/tests
Chris Tate 6330e26eb8 Open a WriteStream's file when its encoding throws
Node's WriteStream constructor calls setDefaultEncoding after the
Writable constructor has scheduled _construct, so with encoding: 'buffer'
it throws ERR_UNKNOWN_ENCODING but the unreachable stream still opens its
file on a later tick, creating it, and with the default 'w' flags
truncating it. The runtime threw before scheduling the open; it now
constructs the stream first, as Node does.

Corpus 5547 ran that check on the file its other blocks write, so the
late truncation raced with the fd block's write and Node's own output
changed with the timing (it printed an empty file on macOS). The check
now uses its own file, and the program prints that the file was created.
2026-10-16 00:46:22 -05:00
..
2026-07-22 18:08:04 -05:00