Skip to content
This repository was archived by the owner on May 19, 2018. It is now read-only.
/ babylon Public archive
This repository was archived by the owner on May 19, 2018. It is now read-only.

Object destructuring inside the rest parameter #512

@peey

Description

@peey

Babel is unable to parse ({ x, ...{ y, z } } = o). It's valid according to the spec.

Input Code / Babylon Configuration

babylon.parseExpression("{ x, ...{y, z} } = o", {"plugins":["objectRestSpread"]});

Expected Behavior

It should parse correctly to be transformed into a functionally equivalent code of the following:

x = o.x
rest = _objectWithoutProperties(o, ["x"])
y = rest.y
z = rest.z

Current Behavior

This error is thrown

SyntaxError: Invalid left-hand side in rest property (1:8)`

Your Environment

software version
Babylon code on master (#0e12f56)
node 6.10.3
npm 3.10.10
Operating System Ubuntu 16.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions