> Le 14 févr. 2014 à 23:40, "C. Scott Ananian" <ecmascr...@cscott.net> a écrit :
> 
> Claude Pache wrote:
>> "Array-likes with negative length" doesn't make sense.
> 
> `Array.prototype.copyWithin.call({ length: -1 }, ... );`
> 
> Call it whatever you like, although I'm always interested in learning
> new phrases of ECMAspeak (if there's an appropriate name for this).
> --scott

Since you are interested: "The abstract operation ToLength converts its 
argument to an integer suitable for use as the length of an array-like object." 
[1] 

It doesn't really matter whether ToLength could extract a reasonable value for 
an unreasonable object, or not. But consistency is important: note that this 
operation is used whenever the length of an arraylike is expected, not only for 
default arguments.

[1] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength

—Claude

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

Reply via email to