OptionalcontextVariable context for @name / @{name} references (default: empty)
OptionalmaxMaximum total dice allowed per evaluation; integer >= 1 (default: 10,000)
OptionalmaxMaximum explosion iterations allowed per die; integer >= 0 (default: 1,000)
OptionalmaxMaximum reroll iterations allowed per die; integer >= 0 (default: 1,000)
OptionalonBehavior when a referenced variable is missing from context (default: 'throw')
Evaluation guardrails and variable resolution, shared by
EvaluateOptionsandRollOptions. Every field is optional — the defaults bound adversarial notation without capping any realistic expression.Tighten them when the notation comes from users you do not control; the caps are the difference between a typed
EvaluatorErrorand a request that rolls ten million dice. Parse depth is capped separately and unconditionally by MAX_PARSE_DEPTH.The three numeric limits fail closed: omit one — or pass
undefinedornull, the no-options path a partial config produces — and it takes its default, but supply anything else that is not a safe integer in range — a string,NaN,±Infinity, a negative, a fraction — and evaluation throwsINVALID_EVALUATION_LIMITbefore rolling.maxDiceaccepts>= 1, the two iteration limits>= 0. No coercion:maxDice: Number(input)on unparseable input rejects rather than quietly reverting to the permissive default.Example: Untrusted input
Example: Variables