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

support destructured params w/defaults (shorthand syntax) #56

Closed
xjamundx opened this issue Feb 9, 2015 · 5 comments
Closed

support destructured params w/defaults (shorthand syntax) #56

xjamundx opened this issue Feb 9, 2015 · 5 comments

Comments

@xjamundx
Copy link
Contributor

xjamundx commented Feb 9, 2015

While support for destructuring was added in #51 none of these cases work:

  • function a({x = 10}) {}
  • function a({x = 10, y: { z = 10 }}) {}
  • ({x = 10}) => x
  • ({x = 10, y: { z = 10 }}) => [x,y]
  • [a=10] = 0
  • var {a = 10} = {}

Latest spec can be found here:
estree/estree#13

@xjamundx
Copy link
Contributor Author

Will spend like 40 minutes trying to get this to work and see what I can come up with...

@nzakas
Copy link
Member

nzakas commented Feb 13, 2015

Cool. Just as an FYI, I'm looking at how we can potentially merge back into Esprima now that it's moving again. I won't stop you if you want to tackle this, just wanted to give to all the info before you spend more time.

@xjamundx
Copy link
Contributor Author

That's great news, we'll see how far along I get. It's good learning :)

@xjamundx
Copy link
Contributor Author

Related jquery/esprima#1028

@xjamundx
Copy link
Contributor Author

Will try to take another stab at this sometime later this week...

xjamundx pushed a commit to xjamundx/espree that referenced this issue Feb 27, 2015
xjamundx pushed a commit to xjamundx/espree that referenced this issue Mar 2, 2015
xjamundx pushed a commit to xjamundx/espree that referenced this issue Mar 2, 2015
@nzakas nzakas closed this as completed in 0ddf492 Mar 5, 2015
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