jashkenas/coffee-script — Issue #1922: 1.1.3 regression? "Unexpected 'CALL_END'" error on inline assignment expression
Author: aseemk
Created: 2011-12-09 22:38:31+00:00
State: open

Hey there,

This block of code used to work in 1.1.2 (I just confirmed by downgrading):

```coffee-script
$actionButton.val label=
if isFollow then 'Follow'
else if isTouch then "✘ Unfollow #{NBSP}"
else "✔ Following #{NBSP}"
```

The intent is that the if/else block's value should be assigned to the variable `label`, and then the `val()` method be called w/ that same value.

The generated JS in 1.1.2:

```javascript
var label;
$actionButton.val(label = isFollow ? 'Follow' : isTouch ? "✘ Unfollow " + NBSP : "✔ Following " + NBSP);
```

In 1.1.3 (you can test via the website), the same block now throws this error:

`PARSE ERROR ON LINE 1: UNEXPECTED 'CALL_END'`

Is this an accidental regression, or a purposeful change? I'm guessing that with the bugfix version bump, it's an accidental regression.

Thanks!

/cc @jeremyis