-
Notifications
You must be signed in to change notification settings - Fork 93
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
Cant check for "variable is not set" in Ternary Expressions #148
Comments
Looks like we should change the default to NULL when variable does not exist. Regarding the more complex expression the TernaryExpressionNode and other ExpressionNodes only support strict variable references - and no nested expressions either. |
I tried that already but had no time to dig further into this. Simply changing this behavior does not work as the function |
It would seem we should not use |
On a side note: this expression node class could use a bit of cleanup to remove the |
It is not possible to check if a variable is not set in a ternary expression.
{ myArray.invalidVariable ? 'yes' : 'no' }
Will always returnyes
becausemyArray.invalidVariable
is evaluated as a string as not variable is found with this name{('{myArray.invalidVariable}' !== '') ? 'yes' : 'no'}
does also not work as the parser does not recognize this syntax as a ternary expression but simply outputs the text.The text was updated successfully, but these errors were encountered: