Ye olde arguments argument (was: Topic list - pending changes and issues for the ES3.1 spec)

Garrett Smith dhtmlkitchen at gmail.com
Tue Sep 9 13:49:21 PDT 2008


On Tue, Sep 9, 2008 at 11:32 AM, Mark S. Miller <erights at google.com> wrote:
> On Tue, Sep 9, 2008 at 9:21 AM, Mark S. Miller <erights at google.com> wrote:
>> How to restrict 'arguments' in strict functions?
>>    anticipation of ES-H-strict -- prohibit co-existence with splat
>>    arguments.callee
>>    joining? frozen?
>



>
> Should strict 'arguments' be an array? I know we've over this before
> and that strong reasons were presented why we couldn't do this. But on
> the ES3.1 phone call this morning no one could remember or regenerate
> those reasons. Anyone? Pointers to previous threads are a fine answer.
> Thanks.
>

The arguments object could have the same methods as array, like a
"subclass" of array, but not have the special [[Put]], and concat()
could still work the way it does with today's arguments object (I
don't actually prefer the current behavior)

(function(){
  return [].concat(arguments).length; // result => 1
})(1,2,3);

Garrett

> --
>    Cheers,
>    --MarkM


More information about the Es-discuss mailing list