Add further warning re defaultValue and nullValue.

This is not the first time someone has been confused by this.
This commit is contained in:
Michael Bayne
2015-12-14 11:34:44 -08:00
parent 51f5840363
commit c1ddff1b6f
+4
View File
@@ -226,6 +226,10 @@ Mustache.compiler().nullValue("what").compile(tmpl).execute(map);
// throws MustacheException when executing the template because doesNotExist cannot be resolved
```
**Do not** use both `defaultValue` and `nullValue` in your compiler configuration. Each one
overrides the other, so whichever one you call last is the behavior you will get. But even if you
accidentally do the right thing, you have confusing code, so don't call both, use one or the other.
### Sections
Sections are not affected by the `nullValue()` or `defaultValue()` settings. Their behavior is