-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
falsey values don't match reference implementation? #38
Comments
Where do you see an example in the spec which demands that zero is to be treated as a falsey value? We run all the examples, so if there were such an example, then the test suite would catch it. |
What is not imposed by the spec is left at implementer's discretion. That said, maybe 0 should be treated as a falsey value. |
We need to check what |
Why? |
Just to get an idea of what other implementations in the same language do. I'll mark this as a feature request awaiting PR, it is unlikely that I'll have time or motivation to do the change myself, but you are welcome to try. |
The reference implementation appears to be the ruby one: Which definitely treats 0 as falsey. So the question is, whether we want to keep underspecified behavior in sync with the reference implementation. |
I'd merge this change. |
https://mustache.github.io/#demo if you set
"empty": 0
it is still treated as falsey. Afair, this was also the case for hastache. But stache does not.Note that the spec seems to talk about falsey not false.
https://github.com/mustache/spec/blob/master/specs/sections.yml#L44
The text was updated successfully, but these errors were encountered: