Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions doc/ref/language.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,16 @@ Field names of Jsonnet objects can be arbitrary strings and can be calculated dy

When an object is evaluated, all the field names are evaluated. This means they cannot refer to object locals, `self`, or `super`. In other words, their scope is "outside of the object".

#### Conditional Fields

If a field name evaluates to null, that field value is discarded and not included in the resulting object. The following code will evaluate to the empty object:

```
{
[if 1 == 2 then "foo"]: "bar",
}
```

## Independence from the Environment (Hermeticity)

Jsonnet programs are *pure computations*, which have no side-effects and which depend only on the values which were explicitly passed.
Expand Down