Code points vs Unicode scalar values

Brendan Eich brendan at
Wed Sep 4 09:46:08 PDT 2013

Mathias Bynens wrote:
> I think what Anne means to say is that `String.fromCodePoint(0xD800)` returns '\uD800` as per that algorithm, which is a lone surrogate (and not a scalar value).

Gotcha. Yes, the new APIs seem to let you write and read lone 
surrogates. But the legacy APIs won't go away, and IIRC the reasoning is 
that we're better off exposing the data than trying to abstract away 
from it in the new APIs. Allen?


More information about the es-discuss mailing list