Le 14 févr. 2014 à 23:40, C. Scott Ananian <[email protected]> a écrit :

> On Fri, Feb 14, 2014 at 11:50 AM, André Bargull <[email protected]> wrote:
>> I think Scott is requesting this change:
>> https://gist.github.com/anba/6c75c34c72d4ffaa8de7
> 
> Yes, although my proposed diff (in the linked bug) was the shorter,
> "12. If end is undefined, let relativeEnd be ToInteger(lenVal); else
> let
> relativeEnd be ToInteger(end)."  Same effect, though.
> 

Just a last note. Beyond the philosophical aspect whether arraylikes of 
negative length make any sense at all, there is a strong technical issue you 
have probably overlooked: For array methods in general, and for the optional 
argument of `Array.prototype.copyWithin` in particular (see step 14 of the 
algorithm), a negative index is not understood as an absolute position, but 
rather as a position relative to the end of the array. For instance, for an 
array (or arraylike) of length `n`, if `-3` is passed, it indicates position 
`n-3`. In your case, it is certainly not the semantics you want. (In fact, 
everything will happily coerce to `0` at the end of the journey, but it's just 
happenstance.)

—Claude

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to