mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-06 08:23:19 +08:00
Writes and deletes of `code` through an error's checked-dynamic node (a `catch (e: any)` binding, a reflective write) changed only the node, so typed `err.code` reads kept the old value. The slot sync that already covered name, message, stack and cause now covers code: a string takes the slot, any other value or a delete clears it. A write, delete or Object.assign through an Error subclass's typed view now syncs the slots the subclass inherits from Error after the class commit, which writes only declared fields. `'code' in err` read the code slot, so an own `code` set to undefined answered false. It now asks the runtime: the slot holds a string, or the error has an own `code` property on its node.