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

ES6 feature: Rest Parameters: tracking Issue #1011

Closed
mikesherov opened this Issue Feb 9, 2015 · 15 comments

Comments

Projects
None yet
4 participants
@mikesherov
Member

mikesherov commented Feb 9, 2015

Syntax:

FormalParameterList[Yield,GeneratorParameter] :
  FunctionRestParameter[?Yield]
  FormalsList[?Yield, ?GeneratorParameter]
  FormalsList[?Yield, ?GeneratorParameter] , FunctionRestParameter[?Yield]
FunctionRestParameter[Yield] :
  BindingRestElement[?Yield]
BindingRestElement[Yield, GeneratorParameter] :
  [+GeneratorParameter] ... BindingIdentifier[Yield]
  [~GeneratorParameter] ... BindingIdentifier[?Yield]

Spec:

https://people.mozilla.org/~jorendorff/es6-draft.html#sec-functions-and-classes

Remaining Tasks:

  • Review and Test Token Generation
  • Review Error Messages
  • Arrow Function Rest Parameters
  • estree/estree#37

@mikesherov mikesherov referenced this issue Feb 9, 2015

Closed

ES6 feature: Arrow Functions: tracking Issue #1012

8 of 8 tasks complete

@mikesherov mikesherov modified the milestone: 2.1 Feb 12, 2015

@mikesherov mikesherov self-assigned this Feb 13, 2015

@mikesherov

This comment has been minimized.

Show comment
Hide comment
@mikesherov

mikesherov Feb 15, 2015

Member

@ariya can you respond to the estree issue about rest and defaults? I think we may want to take acorns approach here.

Member

mikesherov commented Feb 15, 2015

@ariya can you respond to the estree issue about rest and defaults? I think we may want to take acorns approach here.

@ariya

This comment has been minimized.

Show comment
Hide comment
@ariya

ariya Feb 15, 2015

Contributor

@mikesherov I'm not sure why we want to deviate from the existing SpiderMonkey AST for this case.

Contributor

ariya commented Feb 15, 2015

@mikesherov I'm not sure why we want to deviate from the existing SpiderMonkey AST for this case.

mikesherov added a commit to mikesherov/esprima that referenced this issue Feb 16, 2015

Introduce rest parameters for Function Expressions and Declarations
Still errors on rest parameters for arrow function expressions for now as those
are a bit more involved and require a more significant refactor.

Refs #1011

mikesherov added a commit to mikesherov/esprima that referenced this issue Feb 17, 2015

Introduce rest parameters for Function Expressions and Declarations
Still errors on rest parameters for arrow function expressions for now as those
are a bit more involved and require a more significant refactor.

Refs #1011

mikesherov added a commit to mikesherov/esprima that referenced this issue Feb 17, 2015

Introduce rest parameters for Function Expressions and Declarations
Still errors on rest parameters for arrow function expressions for now as those
are a bit more involved and require a more significant refactor.

Refs #1011

mikesherov added a commit to mikesherov/esprima that referenced this issue Feb 17, 2015

Introduce rest parameters for Function Expressions and Declarations
Still errors on rest parameters for arrow function expressions for now as those
are a bit more involved and require a more significant refactor.

Refs #1011

mikesherov added a commit that referenced this issue Feb 17, 2015

Introduce rest parameters for Function Expressions and Declarations
Still errors on rest parameters for arrow function expressions for now as those
are a bit more involved and require a more significant refactor.

Refs #1011
Closes gh-1050

@ariya ariya added es6 and removed es6migration labels Feb 18, 2015

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Mar 2, 2015

Contributor

Just a heads up: I was doing some experimentation and found that there's no good way to support both the harmony branch rest property and the newly-agreed Acorn-like approach (having the rest param in the params array) at the same time. This is because code exists that loops over the params array and then checks to see if rest has a value. That means adding the rest param into the params array would result in double evaluation of a rest param.

So we can really only do one or the other but not both (as opposed to handler and handlers, for instance).

Contributor

nzakas commented Mar 2, 2015

Just a heads up: I was doing some experimentation and found that there's no good way to support both the harmony branch rest property and the newly-agreed Acorn-like approach (having the rest param in the params array) at the same time. This is because code exists that loops over the params array and then checks to see if rest has a value. That means adding the rest param into the params array would result in double evaluation of a rest param.

So we can really only do one or the other but not both (as opposed to handler and handlers, for instance).

@mikesherov

This comment has been minimized.

Show comment
Hide comment
@mikesherov

mikesherov Mar 2, 2015

Member

@nzakas no way to add a flag rather than doing a second loop?

Member

mikesherov commented Mar 2, 2015

@nzakas no way to add a flag rather than doing a second loop?

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Mar 2, 2015

Contributor

Sure, but that's still a breaking change. My point is that existing code will break if we support both at the same time. If we need a breaking change, might as well go all the way and remove rest.

Contributor

nzakas commented Mar 2, 2015

Sure, but that's still a breaking change. My point is that existing code will break if we support both at the same time. If we need a breaking change, might as well go all the way and remove rest.

@mikesherov

This comment has been minimized.

Show comment
Hide comment
@mikesherov

mikesherov Mar 2, 2015

Member

@nzakas I see, you mean consumer code. I'm +1 for removing all the way.

Member

mikesherov commented Mar 2, 2015

@nzakas I see, you mean consumer code. I'm +1 for removing all the way.

@mikesherov

This comment has been minimized.

Show comment
Hide comment
@mikesherov
Member

mikesherov commented Mar 2, 2015

@jeffmo ^ ?

@jeffmo

This comment has been minimized.

Show comment
Hide comment
@jeffmo

jeffmo Mar 2, 2015

Member

Agreed, let's rip the band-aid off

Member

jeffmo commented Mar 2, 2015

Agreed, let's rip the band-aid off

@ariya

This comment has been minimized.

Show comment
Hide comment
@ariya

ariya Mar 2, 2015

Contributor

Hmm, maybe I missed something, but when did I discuss keeping the compatibility? Rest parameter was not feature in 2.0 anyway.

Contributor

ariya commented Mar 2, 2015

Hmm, maybe I missed something, but when did I discuss keeping the compatibility? Rest parameter was not feature in 2.0 anyway.

@jeffmo

This comment has been minimized.

Show comment
Hide comment
@jeffmo

jeffmo Mar 2, 2015

Member

@ariya : I think the breaking-change-ness is only in reference to a breaking change within the harmony branch

Member

jeffmo commented Mar 2, 2015

@ariya : I think the breaking-change-ness is only in reference to a breaking change within the harmony branch

@mikesherov

This comment has been minimized.

Show comment
Hide comment
@mikesherov

mikesherov Mar 2, 2015

Member

@ariya we sort of glossed over it in the meeting quickly. Glad we're all in agreement to just rip off the baindaid!

Member

mikesherov commented Mar 2, 2015

@ariya we sort of glossed over it in the meeting quickly. Glad we're all in agreement to just rip off the baindaid!

@mikesherov

This comment has been minimized.

Show comment
Hide comment
@mikesherov

mikesherov Mar 4, 2015

Member

@nzakas, you have sample code for the switch to restElement?

Member

mikesherov commented Mar 4, 2015

@nzakas, you have sample code for the switch to restElement?

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Mar 5, 2015

Contributor

Assuming you mean consumer code that would be confused by having both, escope is a good example: https://github.com/estools/escope/blob/master/src/referencer.js#L221

Contributor

nzakas commented Mar 5, 2015

Assuming you mean consumer code that would be confused by having both, escope is a good example: https://github.com/estools/escope/blob/master/src/referencer.js#L221

ikarienator added a commit to ikarienator/esprima that referenced this issue Mar 5, 2015

ikarienator added a commit to ikarienator/esprima that referenced this issue Mar 5, 2015

ikarienator added a commit to ikarienator/esprima that referenced this issue Mar 5, 2015

ikarienator added a commit to ikarienator/esprima that referenced this issue Mar 5, 2015

ikarienator added a commit to ikarienator/esprima that referenced this issue Mar 5, 2015

ikarienator added a commit to ikarienator/esprima that referenced this issue Mar 5, 2015

ikarienator added a commit to ikarienator/esprima that referenced this issue Mar 5, 2015

ikarienator added a commit that referenced this issue Mar 5, 2015

@ariya

This comment has been minimized.

Show comment
Hide comment
@ariya

ariya Mar 6, 2015

Contributor

@mikesherov Anything here that is still blocking 2.1?

Contributor

ariya commented Mar 6, 2015

@mikesherov Anything here that is still blocking 2.1?

@mikesherov

This comment has been minimized.

Show comment
Hide comment
@mikesherov

mikesherov Mar 6, 2015

Member

@ariya, yes, the switch from defaults/rest properties to resElement/AssigmentPattern

Member

mikesherov commented Mar 6, 2015

@ariya, yes, the switch from defaults/rest properties to resElement/AssigmentPattern

mikesherov added a commit to mikesherov/esprima that referenced this issue Mar 6, 2015

mikesherov added a commit to mikesherov/esprima that referenced this issue Mar 7, 2015

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