Claude Pache (2015-01-29T01:25:46.000Z)
> Le 29 janv. 2015 à 01:49, Jordan Harband <ljharb at gmail.com> a écrit :
> 
> I suppose we could change the spec, but https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-string-type requires that "The length of a String is the number of elements (i.e., 16-bit values) within it." - if the number can't be represented, then it seems that requirement can't be satisfied. I'm sure one can come up with a counterintuitive reading of the spec, but is that a realistic interpretation of it?

It's not a requirement, it's a definition. But more on the point, the length of a String is simply a nonnegative integer, not a Number value representing such a integer. Not to be confused with the value of the "length" property of that String, which is necessarily a Number value.

—Claude 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150129/2f4b59e4/attachment-0001.html>
d at domenic.me (2015-02-13T23:30:19.249Z)
Le 29 janv. 2015 à 01:49, Jordan Harband <ljharb at gmail.com> a écrit :

> I suppose we could change the spec, but https://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-language-types-string-type requires that "The length of a String is the number of elements (i.e., 16-bit values) within it." - if the number can't be represented, then it seems that requirement can't be satisfied. I'm sure one can come up with a counterintuitive reading of the spec, but is that a realistic interpretation of it?

It's not a requirement, it's a definition. But more on the point, the length of a String is simply a nonnegative integer, not a Number value representing such a integer. Not to be confused with the value of the "length" property of that String, which is necessarily a Number value.