W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2013

Re: an idea for replacing arguments.length

From: Mark S. Miller <erights@google.com>
Date: Mon, 11 Nov 2013 09:40:54 -0800
Message-ID: <CABHxS9jEfawuecpaMiWeezY40Z-o6PdKqZj5iB6Z7c4cgxPEwQ@mail.gmail.com>
To: Allen Wirfs-Brock <allen@wirfs-brock.com>
Cc: Corey Frang <gnarf37@gmail.com>, "public-script-coord@w3.org" <public-script-coord@w3.org>, "es-discuss@mozilla.org list" <es-discuss@mozilla.org>
Doh! My mistake. I was momentarily attributing the old semantics to default
parameter assignment, in which case we wouldn't have had the problem in the
first place.


On Mon, Nov 11, 2013 at 9:21 AM, Allen Wirfs-Brock <allen@wirfs-brock.com>wrote:

>
> On Nov 11, 2013, at 6:10 AM, Mark S. Miller wrote:
>
> That is excellent! Has all the upsides of the best of the other proposals
> and none of the downsides.
>
>
> On Sun, Nov 10, 2013 at 11:33 PM, Corey Frang <gnarf37@gmail.com> wrote:
>
>> Just to provide another way of working around it:
>>
>> var empty = {}; // or even a symbol?
>>
>> function splice(start = empty, count = 0, ...items) {
>>   if (start === empty) { ...
>> }
>>
>>
> No, this doesn't work because then both
>      [1,2,3].splice()
>      [1.2.3].splice(undefined)
>
> will both result in start === empty.  But for web compatibility they must
> be treated differently.
>
> Allen
>



-- 
    Cheers,
    --MarkM
Received on Monday, 11 November 2013 17:41:21 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:19 UTC