jashkenas/coffee-script — Issue #2081: parse error when function as first argument not wrapped in parenthesis
Author: superjoe30
Created: 2012-01-31 04:01:25+00:00
State: open

```coffee
titleSort = generateSort((x) -> x.name, titleCompare)
```

should compile to

```javascript
var titleSort;

titleSort = generateSort((function(x) {
return x.name;
}), titleCompare);
```

instead says `PARSE ERROR ON LINE 1: UNEXPECTED ','`. It works when I instead do

```coffee
titleSort = generateSort(((x) -> x.name), titleCompare)
```

Is there a good reason why I should have to wrap the function in parenthesis?