-
Notifications
You must be signed in to change notification settings - Fork 55
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
Can't evaluate if conditions properly with an undefined variable #157
Comments
A quick fix will be adding this :
Here but it will still fail if the "true" condition is on the right of the operator and not left like this one:
|
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days. |
I've hit this issue too so I'd like this to remain open rather than be auto-closed as stale. It's definitely a pain-point with plush. |
Sure, absolutely! I configured auto close action across all modules to make it easy to maintain, but if any issue is still meaningful, it should remain as open. The main purpose of this autoclose action is actually not to close issues but make it possible to get an insight into the issue. Also, the more information gathered, the better the solution will be. |
I pushed an improved version. I realized my first commit would have ignored syntax errors and returned true if one of the nodes was true. I also added more tests. |
Plush evaluates undefined variables in if conditions without throwing an error; however, it becomes an issue with this example.
Currently, this should return "hi" as one of the conditions
path != "pagePath"
is true; however, it returns an empty string because the if condition values on the right of theor
return an error, so it bubbles back up and results in evaluating the condition as false.This behaviour is inconsistent because this condition evaluates as true
<%= if ( path != "pagePath" || !page) { %>hi<%} %>
The text was updated successfully, but these errors were encountered: