[[]] = f()
$ coffee -bpe '[[]] = f()'
false;
Related (?):
$ coffee -bpe 'for k, {} of o then'
var k;
for (k in o) {
false;
}
Also this one
[] = 1
{} = [1, 3, 5]
[] = {}
I think is has to do with attempting destructuring assignment.
The expression [] = 1 will generate the JavaScript false;
> coffee -bpe "[] = 1"
false;
Using your first example, when the expression [[]] = f() is a parameter of console.log
> coffee -bpe "console.log [[]] = f()"
var _ref;
console.log((_ref = f(), _ref));
Again, the false; statement seems to appear in {} = expr or [] = expr. one - liner.
The expression
[] = 1will generate the JavaScriptfalse;
Oh right. Was assuming those were unaffected from the regression (at 4ce374be25f9d4c0698288bd65f46d24ad707712); not the case apparently.
Looks like all the cases in this ticket were fixed by 230dea1243b544fdcf9aa2647cbb7128a03187a9 as well. Closing.
230dea1243b544fdcf9aa2647cbb7128a03187a9
This effectively reverts #870. $ bin/coffee -bpe '[a, [], b] = c' var a, b; a = c[0], c[1], b = c[2];
@satyr: Yeah, that optimization is now gone. But it was breaking other things anyway, so it was a bad optimization. I will open #870 so that someone can make a good optimization or just implement the [first, ..., last] syntax.