OptionalnodeType: Optionaloptions: ErrorOptionsReadonlycodeStable programmatic identifier for the failure. Branch on this rather
than on message, which is free to change between releases.
ReadonlynodeASTNode.type of the node that raised the error ('Dice', 'BinaryOp',
…). undefined for failures raised outside a node context, such as the
whole-expression dice budget.
Exclusive end offset of the span described by start.
Start offset of the tightest AST node that was being evaluated when the
error was thrown. undefined when the AST was built without parser spans.
Error thrown during AST evaluation.
Lives here rather than in
evaluator/evaluator.tsso the modifier implementations can throw it without importing back into the evaluator — that value-level round trip was a genuine ESM cycle.evaluator.tsre-exports the class for existing importers.Unlike
LexerError/ParseError— which point at a single offset — anEvaluatorErrorcarries a fullstart/endspan covering the failing sub-expression, because by evaluation time the AST knows its own extent.Example