mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-06 08:23:19 +08:00
Inspecting (util.format, %s, util.inspect, console) a value of an Error class whose hierarchy contains program-declared subclasses was refused: errorRenderable counted the subclass layout's repeated builtin prefix fields (name, message) as declared fields. Those are the runtime slots the error base already renders, so field-less subclasses now render. The runtime builds the stackless base from the instance's `name` (`[Error: m]`); Node's improveStack also names the constructor. Each program class (most derived first) is an instanceof arm applying that rule: `[Plain [Error]: m]`, or `[FetchFailedError: m]` when the constructor name contains the error's name. Runtime error classes keep their own header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>