Expressions and scope
Expressions evaluate JSON values. There is no arbitrary JavaScript execution, method invocation, or general function-call API.
Values and scope
| Name | Meaning | Writable? |
|---|---|---|
data | Root data record | No |
props | Explicit component inputs | No |
| State names | Values declared with state | Yes |
host.name | Registered host binding | Only if explicitly writable |
event | Current handler payload | No |
| Handler locals | let / into values | No |
| Item variable | Current For / Item value | No |
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:
| Form | Behavior |
|---|---|
a.b, a[key] | Record member or zero-based list indexing |
not a, -a | Boolean negation, numeric negation |
a * b, a / b | Numeric arithmetic; division by zero fails |
a + b, a - b | Arithmetic; plus also concatenates two strings or two lists |
<, <=, >, >=, in | Comparison / membership |
==, != | Structural equality / inequality |
and, or | Short-circuit boolean operators |
?? | Left value unless null |
condition ? yes : no | Evaluate 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.