Skip to content

Invalid output when a computed property follows a property with an arrow function as value #263

@marijnh

Description

@marijnh

This code:

console.log({
  Right: () => true,
  [1 + 1]: 2
})

Produces this output:

var obj;
console.log(( obj = {
  Right: function () { return true
}; }, obj[1 + 1] = 2, obj ))

... which has a semicolon inside an object literal. Probably once again text is inserted in the wrong order (the closing brace of the arrow relative to the semicolon for the return statement).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions