jashkenas/coffee-script — Issue #2159: js2coffee example converts to coffeescript but errors when converted back to js
Author: Andrewmp1
Created: 2012-02-28 19:45:56+00:00
State: open

If you put this javascript code into js2coffee.org and convert it to coffeescript and then put it back into the conversion it says there is an error

javascript:

App.president = Ember.Object.create({
firstName: "Barack",
lastName: "Obama",
fullName: function() {
return this.get("firstName") + " " + this.get("lastName")
}.property("firstName", "lastName")
});

Converted coffeescript:

App.president = Ember.Object.create(
firstName: "Barack"
lastName: "Obama"
fullName: ->
@get("firstName") + " " + @get("lastName")
.property("firstName", "lastName")
)

It seems like the chaining of the .property on the function isn't picking up correctly with the indent?