coffeescript
coffeescript copied to clipboard
Bug: Implicit object literals in array split improperly
Input Code
a = [
b1: 1
b2: 2
, c1: 1
c2: 2
]
Expected Behavior
var a;
a = [
{
b1: 1,
b2: 2
},
{
c1: 1,
c2: 2
}
];
Current Behavior
var a;
a = [
{
b1: 1,
b2: 2
},
{
c1: 1
},
{
c2: 2
}
];
Context
Fixing this should provide a reasonable alternative to #4952.
Side note: I ran into this issue writing the initial AST tests but never got around to file it (until now). I felt like having read about this syntax/semantics in an official source like coffeescript.org but was unable to find the reference again.
Environment
- CoffeeScript version: v2.5.1