Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Object destructuring inside the rest parameter #512

Closed
peey opened this issue May 7, 2017 · 1 comment · Fixed by #518
Closed

Object destructuring inside the rest parameter #512

peey opened this issue May 7, 2017 · 1 comment · Fixed by #518

Comments

@peey
Copy link
Contributor

peey commented May 7, 2017

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
@hzoo
Copy link
Member

hzoo commented May 7, 2017

Hey @peey! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community that typically always has someone willing to help. You can sign-up here
for an invite.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants