Commit Graph
2 Commits
Author SHA1 Message Date
Chris Tate e36a442468 Throw for primitive Reflect.has targets, record isRaw, and match StringDecoder chunks
Reflect.has over a target held as any, unknown or a union answered a
presence result for a primitive. It now checks the target at run time
after both arguments are evaluated and throws Node's TypeError
("Reflect.has called on non-object"). The stdlib-fence snapshot no
longer lists Reflect.has, which lowers.

process.stdin.isRaw read a flag that only the dynamic setRawMode path
set, so a direct process.stdin.setRawMode(true) on a TTY left it false.
The flag now lives with scr_process_stdin_set_raw_mode, which every
path calls, readline's raw mode included.

StringDecoder.end(chunk) with a dynamic chunk that is undefined threw
ERR_INVALID_ARG_TYPE. It now only flushes, as Node's end skips the
write for undefined. A dynamic ArrayBuffer or SharedArrayBuffer chunk
decoded its contents; write and end now throw Node's
ERR_INVALID_ARG_TYPE for it, as it is not an ArrayBufferView.
2026-10-29 23:59:44 -05:00
Malte UblandClaude Opus 5.5 5c1f32f5f1 string_decoder: write/end over a checked-dynamic chunk
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>
2026-10-29 05:38:29 -07:00