Files
scriptc/tests/diagnostics/error-fields-cause-fences.ts
T
2026-10-20 12:55:55 -05:00

12 lines
392 B
TypeScript

// Node prints an error's own properties in creation order, which puts a
// declared `cause` among the class's other fields. Inspecting an error
// class that declares `cause` beside other fields has no lowering.
import * as util from "node:util";
class Retried extends Error {
override cause: unknown = "first attempt";
retries = 2;
}
console.log(util.inspect(new Retried("failed")));