Maximum String length

Jordan Harband ljharb at gmail.com
Wed Jan 28 16:49:11 PST 2015


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?

On Wed, Jan 28, 2015 at 4:37 PM, Domenic Denicola <d at domenic.me> wrote:

> From: es-discuss [mailto:es-discuss-bounces at mozilla.org] On Behalf Of
> Jordan Harband
>
> > Strings can't possibly have a length larger than Number.MAX_SAFE_INTEGER
> - otherwise, you'd be able to have a string whose length is not a number
> representable in JavaScript.
>
> So? That's a bit inconvenient, but no reason to argue that such a string
> can't exist.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150128/b7837d8f/attachment.html>


More information about the es-discuss mailing list