Skip to main content

NODE_LIMIT

Constant NODE_LIMIT 

Source
pub const NODE_LIMIT: usize = 127;
Expand description

The most nodes one expression may hold.

The engine walks a value with the CALL STACK to display it, convert it to JSON or drop it, so a deeply nested result aborts the process rather than failing: a flat sum of a few thousand terms builds a tree as deep as it is long, and an abort is not something a caller can catch. An expression past this size is refused with the engine’s cancel code instead, which is a recorded divergence (../DIVERGENCE.md): TypeScript raises a JavaScript RangeError of its own a few thousand terms later, and Go grows its stacks and keeps going. The number is the one the jsonic base grammar already applies to nested containers, so a document cannot nest deeper than this anyway.