jashkenas/coffee-script — Issue #1759: Unexpected output when using destructuring assignment in conditions
Author: davidchambers
Created: 2011-10-09 05:13:49+00:00
State: open

## Destructuring assignment

{bar} = foo

compiles to...

var bar;
bar = foo.bar;

## Destructuring assignment in condition

true if {bar} = foo

compiles to...

var bar;
if (bar = foo.bar, foo) {
true;
}

whereas I expected...

var bar;
if (bar = foo.bar) {
true;
}