Create a gist now

Instantly share code, notes, and snippets.

One CoffeeScript ambiguity
App.messageController = Ember.Object.create
message: "Hello, world!"
# Compiles to:
# App.messageController = Ember.Object.create({
# message: "Hello, world!"
# });
# Okay, let's refactor it and delete the message property:
App.messageController = Ember.Object.create
# Compiles to:
# App.messageController = Ember.Object.create
# Oops, your controller is now the Ember.Object#create function!
@alexgorbatchev

same as

return {
  foo: 123
}

and

return
{
  foo: 123
}

:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment