Skip to content

Spread operator doesn't evaluate internals #73

@ElliotChong

Description

@ElliotChong

As per CoffeeScript's default behavior of evaluating statements, I was surprised to find that the following statements within a spread operator result in the CJSX error: SyntaxError: Unexpected end of input: unclosed CJSX_EL

render: ->
  <SomeComponent {...{foo: "bar"}}/>
render: ->
  foo = "bar"
  <SomeComponent {...{foo}}/>
render: ->
  foo = "bar"
  <SomeComponent {...({foo})}/>
render: ->
  foo = "bar"
  <SomeComponent {...(do -> {foo})}/>

Expected output is for a structured assignment of { foo: foo } and passing that result to the spread method.

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