CoffeeScriptRedux
CoffeeScriptRedux copied to clipboard
Object Literal Array Shorthand
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
Is there any plan to support this format?
Yes, it must be supported for compatibility. I just haven't prioritised fixing it because I recommend against using this style.