-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Qute IfSectionHelper - consider truthy values during evaluation #8582
Comments
Instead of JavaScript rules, I'd suggest using Groovy rules: http://groovy-lang.org/semantics.html#Groovy-Truth (which are actually pretty close to what you describe). |
@Ladicek +1 I was thinking of using this https://github.com/trimou/trimou/blob/master/core/src/main/java/org/trimou/util/Checker.java#L84-L101 which is essentially the same (except for the matchers). |
If we want to do that, let's do it dirty and use the PHP or Javascript rules :). That will be far more interesting and a constant stream of easy bugs to fix :). |
We're not talking about a proper type coercion ;-). Those rules are IMO fine (if documented). |
Currently, the param must be evaluated to
true
. We could consider a truthy value instead. I.e. something like https://developer.mozilla.org/en-US/docs/Glossary/Truthy.Also consider adding theWe can use logical complement, e.g.unless
tag that would render the content if the param evaluates to afalsy
value.{#if !collection}
.Examples:
The text was updated successfully, but these errors were encountered: