class A extends Error {}
new A("x").stack // node: string perry: undefined
Object.prototype.toString.call(new A("x")) // node: "[object Error]" perry: "[object Object]"
new Error("x").stack // both: string <-- the BASE class is fine
Only subclasses are affected, which localises this to whatever Error construction does for a derived class.
User-visible consequence in cc
claude doctor and claude --max-budget-usd abc print, under node, ~10 real frames with source positions — 14,573 bytes of stderr. Under perry the same commands print - at <anonymous> and 120 bytes. The bundle has 93 extends Error classes and 106 .stack uses, so essentially every diagnostic cc emits loses its trace.
The toString tag divergence is likely the same root: a derived Error isn't being branded as an Error.
Found by a differential stress-test of claude-code under perry.
Only subclasses are affected, which localises this to whatever
Errorconstruction does for a derived class.User-visible consequence in cc
claude doctorandclaude --max-budget-usd abcprint, under node, ~10 real frames with source positions — 14,573 bytes of stderr. Under perry the same commands print- at <anonymous>and 120 bytes. The bundle has 93extends Errorclasses and 106.stackuses, so essentially every diagnostic cc emits loses its trace.The
toStringtag divergence is likely the same root: a derived Error isn't being branded as an Error.Found by a differential stress-test of claude-code under perry.