Conformance Examples 0.1.0 — Render: each-block¶
each-array-iterates-in-order¶
A {{#each X }} block over a JsonArray iterates elements in order with {{this}}.
Template
Context
Output
each-array-of-objects-pushes-object-context¶
Iterating an array of objects lets the body resolve fields on each element.
Template
Context
Output
each-object-iterates-in-insertion-key-order¶
A {{#each X }} block over a JsonObject iterates its entries in insertion order, pushing each value.
Template
Context
Output
each-empty-array-no-else-emits-nothing¶
Empty array, no else arm: emits nothing.
Template
Context
Output
each-empty-array-with-else-renders-else¶
Empty array, else arm present: renders the else arm.
Template
Context
Output
each-empty-object-with-else-renders-else¶
Empty object, else arm present: renders the else arm.
Template
Context
Output
each-missing-key-no-else-emits-nothing¶
Identifier resolves to nothing (missing key), no else: emits nothing.
Template
Context
Output
each-missing-key-with-else-renders-else¶
Identifier resolves to nothing (missing key), else arm present: renders the else arm.
Template
Context
Output
each-primitive-no-else-emits-nothing¶
Identifier resolves to a JsonPrimitive, no else: emits nothing.
Template
Context
Output
each-primitive-with-else-renders-else¶
Identifier resolves to a JsonPrimitive, else arm present: renders the else arm.
Template
Context
Output
each-root-context-as-object-iterates-values¶
{{#each this}} with no nesting iterates the root context object's entries in insertion order, pushing each value.
Template
Context
Output
each-nested-blocks¶
Each blocks can be nested; inner {{this}} sees the inner element, outer context is restored after.
Template
Context
Output
each-parent-pointer-from-body¶
Inside an each body, ../X resolves against the outer (pre-iteration) context.
Template
Context
Output
each-pop-restores-outer-context¶
After an each block ends, the outer context is restored for following interpolations.
Template
Context
Output
each-peer-blocks¶
Two each blocks at the same level each push and pop correctly.
Template
Context
Output
each-non-this-on-primitive-element-is-null¶
When the array element pushed onto the stack is a primitive, any non-this identifier soft-fails and resolves to null.
Template
Context
Output
each-object-non-this-on-primitive-value-is-null¶
Object iteration pushes each value; if the value is a primitive, non-this identifiers soft-fail and resolve to null.
Template
Context
Output
each-with-block-inside-each¶
A {{#with}} nested inside an {{#each}} body works and pops correctly back to the iteration element.
Template
Context
Output
each-empty-array-with-empty-else-emits-nothing¶
Empty array with present-but-empty else arm emits nothing (else is rendered, but it has no content).
Template
Context
Output
each-object-non-sorted-keys-preserve-insertion-order¶
Struct iteration order is insertion order, not alphabetical: keys 'z', 'a', 'm' (already out of sorted order) render in that exact insertion sequence. A HashMap-backed port would fail this fixture.
Template
Context
Output
each-doubled-adjacent-each-same-key¶
Two adjacent {{#each}} blocks over the same key iterate independently; the second is unaffected by the first.
Template
Context
Output
Source fixture: render/each-block.json