Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object Spread operator #23

Closed
iddan opened this issue Dec 14, 2017 · 2 comments
Closed

Object Spread operator #23

iddan opened this issue Dec 14, 2017 · 2 comments
Assignees

Comments

@iddan
Copy link

iddan commented Dec 14, 2017

I think this is a low hanging fruit once you have objects and merging work right. Basically a { a: 2, ...obj } should be transformed to merge({ a: 2 }, obj) and there should be no comma after the spread operator

@ballercat
Copy link
Owner

Seems reasonable and useful.

Would require the ... operator support, which will get difficult. As then it would be reasonable to support syntax like

const { x, y } = vector;
// and
const [x, y] = vector;

as well as some other ES6 goodies, like destructuring function parameters. This is by no means an easy thing to get right, but super useful to have.

A change like this will require a ton of testing.

@iddan
Copy link
Author

iddan commented Dec 24, 2017

I think it's more important to support { ...x } support before destructing assignment

@ballercat ballercat self-assigned this Jan 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants