Skip to content

Invalid JS: Splatted statement causes if block inside array element #1349

@satyr

Description

@satyr
$ coffee -bpe '[a if b...]'
var __slice = Array.prototype.slice;
__slice.call(  if (b) {
    a;
  });

$ coffee -e '[a if b...]'

.:3
  __slice.call(    if (b) {
                   ^^
SyntaxError: Unexpected token if

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions