Continuing woes in reading the ES6 spec language

Oliver Hunt oliver at apple.com
Fri Sep 13 09:11:03 PDT 2013


Okay so we were discussing among ourselves, and we thought that a sane "desugaring" for

function f(x=expr) {
...
}

would be

function f(x) {
  if (arguments.length < 1) x=expr;
  ...
}

This would produce a consistent and easy to follow semantic for default evaluation, it doesn't introduce any new types of scope, nor does it require any new concepts (temporal dead zones, etc) to be learned by a developer who just wants default parameter values.

We also felt that if you use default or rest parameters we should consider that as a opt out from the magic arguments object, and just poison the arguments identifier entirely (no read, write, or declare)

--Oliver



On Sep 13, 2013, at 4:43 AM, Andreas Rossberg <rossberg at google.com> wrote:

> On 13 September 2013 11:27, Till Schneidereit <till at tillschneidereit.net> wrote:
>> On Thu, Sep 12, 2013 at 11:14 PM, Allen Wirfs-Brock <allen at wirfs-brock.com>
>> wrote:
>>> 
>>> On Sep 12, 2013, at 1:50 PM, Brendan Eich wrote:
>>> 
>>>> I thought we agreed with Andreas Rossberg's proposal to isolate default
>>>> expressions from hoisted body declarations, as if (kind of) desugaring
>>> 
>>> Damned if I know...there is a big note in the draft that says: "This
>>> version reflects the consensus as of the Sept. 2012 TC39 meeting.  However,
>>> it now appears that the binding semantics of formal parameters  is likely to
>>> change again. "  So, this may not be the latest consensus and I'm not
>>> actually sure there is a current consensus.
>>> 
>>> I know some of us weren't very happy with that de-sugaring.
>>> 
>>> I'm pretty sure some decisions were left hanging.  I'll need to review
>>> notes, etc.
>> 
>> It looks like the last time tc39 discussed this was 2012-11-29[1]
>> 
>> The resolution back then was that Andreas should draft a proposal for the
>> next meeting. I can't find any mention of that being discussed in later
>> meetings, though, so this seems to have been left undecided indeed.
>> 
>> [1]:
>> https://github.com/rwaldron/tc39-notes/blob/master/es6/2012-11/nov-29.md#scoping-for-default-arguments-revisited
>> [2]:
>> https://github.com/rwaldron/tc39-notes/blob/master/es6/2012-11/nov-29.md#conclusionresolution-1
> 
> Ouch. I'm sorry, I obviously dropped the ball on this. I'll try to
> draft something for next week.
> 
> /Andreas
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss



More information about the es-discuss mailing list