Claude Pache (2014-02-17T17:08:08.000Z)
domenic at domenicdenicola.com (2014-02-21T20:18:17.539Z)
Le 14 févr. 2014 à 23:40, C. Scott Ananian <ecmascript at cscott.net> a écrit : > 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.)