String.prototype.reverse() might break web compatibility, how about
String.prototype.turnyRoundy()?

On 17 Mar 2018 18:47, "Claude Pache" <[email protected]> wrote:

>
>
> Le 17 mars 2018 à 19:29, Oriol _ <[email protected]> a écrit :
>
> Be aware your code breaks pair surrogates, which might be undesirable:
>
> ```js
> var str = "a_\uD83D\uDE80_b";
> str.split("").reverse().join(""); // "b_\uDE80\uD83D_a" :(
> [...str].reverse().join("");      // "b_\uD83D\uDE80_a" :)
> ```
>
> —Oriol
>
>
> Well, but be aware that the corrected implementation still breaks
> graphemes composed by a sequence of code points, such as: n̈ ( LATIN SMALL
> LETTER N + COMBINING DIEARESIS), which might be undesirable...
>
> Anyway, what are the use cases?
>
> —Claude
>
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to