On Sat, Dec 1, 2012 at 2:09 AM, Mathias Bynens <[email protected]> wrote:
> On 30 Nov 2012, at 22:50, Norbert Lindenberg < > [email protected]> wrote: > > > There's nothing in the proposal yet because I intentionally kept it > small. It's always possible to add functionality, but we need some evidence > that it will be widely used. > > My guess would be that in 99% of all cases where `String.prototype.length` > is used the intention is to count the code points, not the UCS-2/UTF-16 > code units. I don't think this is right. My guess is that in most cases where it matters either way, the intention is to get a count that's consistent with .charAt(), .indexOf(), .slice(), RegExp match.index, and every other place where string indexes are used. That said, of course this is a sensible feature to add; but calling it ".realLength" wouldn't help anyone understand the rather fine distinction at issue. -j
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

