default `deleteCount` value of `Array.prototype.splice`

Luke Hoban lukeh at microsoft.com
Tue Jul 3 12:35:59 PDT 2012


On Tuesday, July 3, 2012 11:42 AM, Allen Wirfs-Brock wrote:

> On Jul 3, 2012, at 9:07 AM, Brendan Eich wrote:

>> 
>> Causality was the other way, of course: I implemented splice in SpiderMonkey in 1997 based on Perl 4:
>> 
>> http://perldoc.perl.org/functions/splice.html
>> 
>> and indeed it handles omitted OFFSET and LENGTH the same. IE8 is just defying a de-facto standard, news at 11 :-P.

> and I have no idea why ES3 did not codify the FF implementation.  Prior to the emergence of Safari and Chrome it probably would have been a stretch to say that the FF behavior was a de facto standard and it is always tricky for implementors to navigate through situations where there is divergence between the de jour and de facto standards. 

Looks like this was also discussed in 2010 on this list: https://mail.mozilla.org/pipermail/es-discuss/2010-October/012012.html.  

>> 
>> Agree we should codify this in ES6.

>Agreed, the ES6 standards and implementations should get aligned on this.  In theory it could go either way, but in this case changing the standard to match the majority of implementations seems like the reasonable thing to do.

IE9/10 also implement the single argument extension, so standardizing this in ES6 would align with now de-facto behavior in modern browsers.

>Does somebody want to file a bug so we can track this?

Opened bug 429 against the ES6 drafts. https://bugs.ecmascript.org/show_bug.cgi?id=429 

Luke




More information about the es-discuss mailing list