Maximum String length
claude.pache at gmail.com
Wed Jan 28 17:25:46 PST 2015
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss