Skip to content

Bug: Implicit object literals in array split improperly #5330

@Inve1951

Description

@Inve1951

#try

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions