mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-05 08:13:06 +08:00
The key-order witness pass chose a shape's enumeration table from the order its object literals write their keys, but two gaps sent literal values back to the declaration order (JSON.stringify, Object.keys and inspect then differed from Node, silently): - Witness notes are keyed by node identity, and frontend passes that run before the witness pass (the caught-value dispatch, the class dynamic dispatch) rebuild whole function bodies through mapExprChildren, so every record literal in such a function became an unnoted construction that pins its shape. The mapper now reports rebuilt record literals to an observer, and the notes follow them to the rebuilt node. - A shape a checked conversion (typed JSON.parse) also builds stayed pinned to today's table even when the program's own literals build it in another order, such as a message sent to a child and parsed back. It now takes its literals' order; parsed values in another order keep their own through the record-source view, and a shape only checked conversions build keeps today's table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>