mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-31 07:23:06 +08:00
Records inherit toString, toLocaleString, valueOf, hasOwnProperty, isPrototypeOf and propertyIsEnumerable. Calls of these methods by name run an own callable entry when the record's type allows one and the record holds it, and otherwise the built-in with the record as receiver; toLocaleString, valueOf and isPrototypeOf on records were refused, and toString ignored an own entry. Keyed reads of records of functions answer the built-in as a native function value when the key misses: bound to the record when called at once, with an undefined `this` otherwise. The backend fuses the read with its fallback, so hits cost nothing extra. Records of other value types keep reading undefined for these names; the limitations page says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>