Single-character screwup with _and might want to be error rather than silent?
Summary:
I just spent a while debugging a problem with _and, where
_if(
_and(
$file-updates -> _isNonEmpty,
$file-updates -> _hasPermission(Who Can Edit._self),
),
_QLButton(...)
)
was never producing a button.
The error is the comma at the end of $file-updates -> _hasPermission(Who Can Edit._self),
- I'm guessing that _and
takes it to mean there's a 3rd parameter, evaluates it to empty (as it is), and so always returns false.
Noticing this took a while; it's easy to miss the spurious comma even in this short statement, and in a longer one it'd be more obfuscated. I'm not sure if there's an easy way to make this QL produce an error while maintaining _and
's core features of "variable number of parameters" and "receive Lists and evaluate to false if any elements are empty", but if so, it'd be a good idea.