You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...which is not applying the 'not' operator to the entire result.
I was expecting this:
if (!(foo || (foo = bar))) {
baz();
}
The below examples all have a falsy condition result, but swap the assignment result and position of the conditional assignment. I believe the last example is incorrect. This is on master (ef0cb46 at the time of writing) and 1.2.0.
Yep, it looks like ||= isn't being negated properly. We're not adding the necessary parentheses.
edit: A temporary solution is adding parentheses around the expression yourself. Apparently they're being preserved...
$ coffee -bep 'a = null; b unless a ||= c'
var a;
a = null;
if (!a || (a = c)) {
b;
}
$ coffee -bep 'a = null; b unless (a ||= c)'
var a;
a = null;
if (!(a || (a = c))) {
b;
}
Something like:
...is compiled as:
...which is not applying the 'not' operator to the entire result.
I was expecting this:
The below examples all have a falsy condition result, but swap the assignment result and position of the conditional assignment. I believe the last example is incorrect. This is on master (ef0cb46 at the time of writing) and 1.2.0.
The text was updated successfully, but these errors were encountered: