Skip to main content

Expressions and scope

Expressions evaluate JSON values. There is no arbitrary JavaScript execution, method invocation, or general function-call API.

Values and scope​

NameMeaningWritable?
dataRoot data recordNo
propsExplicit component inputsNo
State namesValues declared with stateYes
host.nameRegistered host bindingOnly if explicitly writable
eventCurrent handler payloadNo
Handler localslet / into valuesNo
Item variableCurrent For / Item valueNo

Values are null, booleans, finite binary64 numbers, strings, lists, or string-keyed records. Use strings for exact external IDs and decimal money. There are no prototypes or executable members.

Operators​

Listed from tighter to looser precedence:

FormBehavior
a.b, a[key]Record member or zero-based list indexing
not a, -aBoolean negation, numeric negation
a * b, a / bNumeric arithmetic; division by zero fails
a + b, a - bArithmetic; plus also concatenates two strings or two lists
<, <=, >, >=, inComparison / membership
==, !=Structural equality / inequality
and, orShort-circuit boolean operators
??Left value unless null
condition ? yes : noEvaluate the selected branch

Conditions and boolean operators require booleans. Strings compare by Unicode scalar value, without locale normalization. Record membership checks keys; list membership checks structural values. No truthy/falsy coercion or JavaScript && / || operators apply.

Example​

<Text bind-text="data.name == null ? 'Welcome' : 'Hello, ' + data.name" />

Rules and validation​

Missing record keys yield null; further access on null fails. List indices must be integral and in bounds. Strings are not indexable. Escape XML ampersands, less-than signs, and matching attribute quotes. Use semicolons between ordinary handler commands; line breaks are whitespace, not command separators.

Data lesson · Commands · bind-*