mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-07 08:33:50 +08:00
A keyed read whose checker type is a record but whose storage is `record | null` (iconv-lite's `module.exports.encodings = null`, filled on first use and read as `encodings[enc]`) built a recordKeyGet on the union and failed IR validation with SC9001. The optional-receiver guard that keyed reads already use for `record | undefined` now also takes a null arm for string and number keys: the receiver and key evaluate once, a null receiver throws Node's "Cannot read properties of null (reading 'k')", and a present one reads the record. Other keys keep their checked-dynamic read, and keyed writes are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>