holes in spread elements/arguments

Allen Wirfs-Brock allen at wirfs-brock.com
Fri Sep 30 15:27:31 PDT 2011


On Sep 30, 2011, at 9:42 AM, Erik Arvidsson wrote:

> On Thu, Sep 29, 2011 at 12:53, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
>> Also, note that I've currently spec'd ES6 so that 'arguments' can be used as
>> a rest parameter name.  In other words
>>    function foo(...args) {return args}
>> and
>>   function foo(...arguments) {return arguments}
>> are semantically equivalent.
>> I did this to  enable to make it easier to migrate code  such as:
>>    function foo() {baz(arguments)}
>> to
>>    function foo(...arguments) {baz(arguments)}
> 
> Minus the Arguments class I hope.
> 

I'm missing you point. What do you mean by "Arguments" class.
as currently spec'd 
   function foo(...arguments) {baz(arguments) }
is semantically the same as
   function foo(...args) {baz(args) }

The only difference is the name binding for the rest parameter.  In both cases it is a regular Array object, not an ES5 arguments objects. 

Did you have something else in mind?

Allen



More information about the es-discuss mailing list