mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-07 08:33:50 +08:00
A named property read on a value typed unknown goes through the property helper the class dispatch generates. Its read compared the property bag with the receiver and then read from it, and the bag expression was evaluated at each use: three calls that each retained and released the receiver. Releasing a record capsule whose fields can form cycles also buffers it as a cycle candidate, so a single `u.id` paid that three times. The helper now evaluates the bag once into a local. Typed records seen as unknown also find a field by comparing the key pointer with the interned field names first, since compiled reads pass the same literal, before comparing bytes, and records whose fields are all required skip the presence check.