Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object Literal Array Shorthand #308

Open
DavidSouther opened this issue Apr 22, 2014 · 2 comments
Open

Object Literal Array Shorthand #308

DavidSouther opened this issue Apr 22, 2014 · 2 comments

Comments

@DavidSouther
Copy link

DavidSouther commented Apr 22, 2014

In Redux, this does not compile:

arr = [
  animal: 'dog'
  sound: 'woof'
,
  animal: 'cat'
  sound: 'meow'
]

http://michaelficarra.github.io/CoffeeScriptRedux/#try:%0Aarr%20%3D%20%5B%0A%20%20animal%3A%20'dog'%0A%20%20sound%3A%20'woof'%0A%2C%0A%20%20animal%3A%20'cat'%0A%20%20sound%3A%20'meow'%0A%5D%0A

In CoffeeScript, it compiles to

var arr;
arr = [
  {
    animal: 'dog',
    sound: 'woof'
  }, {
    animal: 'cat',
    sound: 'meow'
  }
];

http://coffeescript.org/#try:arr%20%3D%20%5B%0A%20%20animal%3A%20'dog'%0A%20%20sound%3A%20'woof'%0A%2C%0A%20%20animal%3A%20'cat'%0A%20%20sound%3A%20'meow'%0A%5D%0A

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1781147-object-literal-array-shorthand?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github).
@cybertk
Copy link

cybertk commented Sep 3, 2014

Is there any plan to support this format?

@michaelficarra
Copy link
Owner

Yes, it must be supported for compatibility. I just haven't prioritised fixing it because I recommend against using this style.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants