I'm just getting started with Coffeescript, so I may be asking something really trivial, but this "bug" recently tripped me up:

```
class Foo
  toJSON_1: ->
    title: 'toJSON_1'
    items: i for i in [1..5]

  toJSON_2: ->
    items: i for i in [1..5]
    title: 'toJSON_2'

  toJSON_3: ->
    items: (i for i in [1..5])
    title: 'toJSON_3'

foo = new Foo
console.log(foo.toJSON_1())
console.log(foo.toJSON_2())
console.log(foo.toJSON_3())

```

I would have considered all of these equivelant, but look what happens with `JSON_2`:

```
{ title: 'toJSON_1', items: [ 1, 2, 3, 4, 5 ] }
{ title: 'toJSON_2' }
{ items: [ 1, 2, 3, 4, 5 ], title: 'toJSON_3' }

```

It took a while to debug, because I was following along with a tutorial using notation `JSON_1`, but in my code the list comprehension was not the last item (i.e. `JSON_2`), until I stumbled upon testing `JSON_3`.

Can someone explain to me why the CoffeeScript parser works with this way? And what is the proper idiom in the general case? Should I always wrap list comprehensions inside parens? Sounds like a bug waiting to happen to always assume there will only be one list comprehension and it will be at the end of the object declaration.

Maybe this is just a peculiar situation of a parser rule I'm not aware of...?

**EDIT:**

Playing with the compiler and generated Javascript some more, it looks like it's enough to wrap the code in `{}` brackets for Coffeescript to do the *right thing*:

```
 toJSON_2: ->
   {
     items: i for i in [1..5]
     title: 'toJSON_2
   }

```

I guess my question boils down to: 

* is it more idiomatic to use the `{}` brackets or put parentheses
around the list comprehensions?
* is this "unpredictable" behavior a bug?
* if not, why not?