On Oct 24, 2014, at 9:11 AM, Brendan Eich wrote:

> André Bargull wrote:
>> IE11 moves elements up one index, throws a RangeError and completes 
>> instantly (no hang or oom).
> 
> Per spec, huzzah -- but the spec needs fixing.

That conclusion isn't so obvious to me.  The current algorithms for the generic 
array methods are generally written to operate without knowledge of target 
object size limits.  In the most general casees there isn't a single common way 
to predetermine size limits of any object that the method might be applied to.  
That's why there usually isn't any pre-flight limit checking in most of the 
algorithms. 

In some specific cases such as for exotic array instances there are available 
means to get the data that would be needed to fail fast.  But to generalize 
that to any "array-like" object would probably require adding new public 
protocol that the algorithms could use to query objects about length limits.

These are most old algorithms that are believed to be correct.  The fact that 
implementations haven't consistently  and correctly implemented them isn't 
sufficient justification to risk tweak ing them this close to the completion of 
ES6.

Of course, I don't have any problem with somebody starting a project to review 
and further backwards-compatability refine these algorithms targeting future ES 
editions.

Allen
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to