@@iterator in arguments object

Allen Wirfs-Brock allen at wirfs-brock.com
Sun Dec 23 16:59:22 PST 2012


As of ES5, apply doesn't require its 2nd arg to be a "real array". An arguments object works fine there.

Brendan Eich <brendan at mozilla.com> wrote:

>Wes Garland wrote:
>> Arguments object is used here to fill the rest void, but also as an 
>> argument to apply (after converting into a real array) when writing 
>> wrapper functions; eg monkey patches, userspace profiling, etc.
>>
>> Is there an ES6 way to use apply on rest params?
>
>A rest parameter is a real Array instance. Function.prototype.apply 
>works on array instances. What's the problem?
>
>/be
>
>> If not, arguments must live on.
>>
>> Sent from my iPhone
>>
>> On 2012-12-23, at 12:48, Brandon Benvie <brandon at brandonbenvie.com 
>> <mailto:brandon at brandonbenvie.com>> wrote:
>>
>>> Yeah good point, and you don't even need to dump all the named 
>>> params. In light of this, I think its feasible to pronounce the 
>>> arguments object in ES6 as vestigial and ready for retirement (except 
>>> for all the legacy code of course). ES6 claims another victim: 
>>> [object Arguments].
>>>
>>> On Sunday, December 23, 2012, Brendan Eich wrote:
>>>
>>>     You could always use an explicit rest parameter as the only
>>>     formal parameter and still dispense with arguments in new code.
>>>
>>>
>>> _______________________________________________
>>> es-discuss mailing list
>>> es-discuss at mozilla.org <mailto:es-discuss at mozilla.org>
>>> https://mail.mozilla.org/listinfo/es-discuss
>_______________________________________________
>es-discuss mailing list
>es-discuss at mozilla.org
>https://mail.mozilla.org/listinfo/es-discuss
>


More information about the es-discuss mailing list