Skip to content

Destructuring assignment to grouped spread arg should pass #872

@pvdz

Description

@pvdz

Input:

({...(obj)} = foo)

Expecting similar output as Babel (which will accept it). This is a destructuring assignment rest property which has looser syntax than with other patterns. The parenthesis are fine here because it's supposed to match a LeftHandSideExpression.

https://tc39.es/ecma262/#prod-AssignmentRestProperty
https://tc39.es/ecma262/#prod-DestructuringAssignmentTarget

https://astexplorer.net/#/gist/15eb31fbb1024faa6f42a4940d8beb4a/4aee1037f36aee9aaa0ffaac61e7ce4a3c1ba95e

(Unfortunately, Babel also accepts ({...(obj)}) => x, which is definitely illegal but regardless I'm confident it is legit in assignments)

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