Files
scriptc/docs/content/limitations/language-features/error-causes.mdx
T
Chris Tate 9f2e9b00c9 Write the limitations partials one sentence per line
Each limitations partial held its whole text on one line (map-and-set.mdx
was a single 1,080-character line), so any two edits to the same partial
conflicted. The partials now put one sentence per line, with a bullet's
continuation lines indented two spaces. Markdown joins the lines, so the
rendered pages are unchanged.

scripts/limitations-partials.mjs reads a labeled bullet's indented
continuation lines as part of the bullet when it splits and joins the page,
and AGENTS.md states the convention.
2026-10-19 00:11:31 -05:00

7 lines
799 B
Plaintext

- **Error causes:** Accessor constructor options are unsupported.
Subclasses may redeclare `cause` as `unknown` or `object` (for example `cause?: unknown`), which defines the own property after `super()` returns as Node does; redeclarations with other types, parameter properties, and accessors named `cause` are unsupported.
`Error`, `TypeError`, `RangeError`, and `SyntaxError` otherwise accept `{ cause }`, including through inherited constructors.
Reads, writes, deletion, and `"cause" in error` distinguish an absent cause from an explicitly undefined cause.
Constructor causes are non-enumerable; assignment to an absent cause creates an enumerable property.
Property descriptors and checked-value aliases share the cause, including getters and setters installed after construction.