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

Terser arrow function + destructuring syntax - thoughts? #653

Closed
bcherny opened this Issue Aug 6, 2016 · 4 comments

Comments

Projects
None yet
3 participants
@bcherny

bcherny commented Aug 6, 2016

This is my first time posting here, and I'm not sure this is the right place to do it, but I was wondering what you guys think of making parens around destructured arrow function parameters optional. If this gets positive feedback, I can write up a proposal:

// Today
let fn1 = _ => _ + 1
let fn2 = ({_}) => _ + 1
let fn3 = ([_]) => _ + 1

// Proposed (more uniform syntax)
let fn1 = _ => _ + 1
let fn2 = {_} => _ + 1
let fn3 = [_] => _ + 1
@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Aug 6, 2016

Member

How can a parser/engine know that those aren't an object literal, a block, or an array literal, without having to backtrack when it finds the "=>"?

Member

ljharb commented Aug 6, 2016

How can a parser/engine know that those aren't an object literal, a block, or an array literal, without having to backtrack when it finds the "=>"?

@bcherny

This comment has been minimized.

Show comment
Hide comment
@bcherny

bcherny Aug 6, 2016

How does it know with the current syntax?

bcherny commented Aug 6, 2016

How does it know with the current syntax?

@michaelficarra

This comment has been minimized.

Show comment
Hide comment
@michaelficarra

michaelficarra Aug 6, 2016

Member

and I'm not sure this is the right place to do it

It is not the right place. From CONTRIBUTING.md:

Feature Requests

Feature requests for future versions of ECMAScript should not be made in this repository. To make a feature request, post to the es-discuss mailing list. Your goal will be to convince others that your proposal is a useful addition to the language and recruit TC39 members to help turn your request into a proposal and shepherd it into the language.

Member

michaelficarra commented Aug 6, 2016

and I'm not sure this is the right place to do it

It is not the right place. From CONTRIBUTING.md:

Feature Requests

Feature requests for future versions of ECMAScript should not be made in this repository. To make a feature request, post to the es-discuss mailing list. Your goal will be to convince others that your proposal is a useful addition to the language and recruit TC39 members to help turn your request into a proposal and shepherd it into the language.

@bcherny

This comment has been minimized.

Show comment
Hide comment
@bcherny

bcherny Aug 7, 2016

@michaelficarra - Got it, will post on es-discuss instead.

bcherny commented Aug 7, 2016

@michaelficarra - Got it, will post on es-discuss instead.

@bcherny bcherny closed this Aug 7, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment