Subject: [Json] ECMAScript v6 adds new escape sequence: \u{x…}

From: "Manger, James H" <[email-masked]>
Date: Tue, 12 Mar 2013 16:11:51 +1100

One change to JSON in ECMAScript v6 from RFC 4627 (and from ECMAScript v5) appears to be a new way of writing a Unicode escape.

In RFC 4627, a Unicode escape is \uxxxx (where x is a hex digit).
In an ECMAScript 6th edition draft (2012-11-22), a Unicode escape can be \uxxxx, or \u{x...}.
Hence, "\n" = "\u000A" = "\u{A}".

See UnicodeEscapeSequence at http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.4.

Maybe.

This ECMAScript edition 6 draft actually defines UnicodeEscapeSequence twice: once in section 7.8.4 with \uxxxx and \u{x...}; and also in Annex A.1 "Lexical Grammar" with only \uxxxx. My guess is that the former is right and the latter just hasn't been updated yet.

\u{x...} is nicer for Unicode code points over 0xFFFF, but I doubt it is worth introducing at this point.

Anyway, one more item for RFC4627bis to consider.

--
James Manger

---

From: Paul Hoffman <[email-masked]>
Date: Tue, 12 Mar 2013 07:34:24 -0400

Can you send a pointer to the list of where we can get the ECMAScript v6 draft? I found a link to a months-old one, but having an up-to-date one would be useful.

--Paul Hoffman

---

From: Carsten Bormann <[email-masked]>
Date: Tue, 12 Mar 2013 07:37:53 -0400

> Hence, "\n" = "\u000A" = "\u{A}".

Why would that nice new JS feature change JSON?

Grüße, Carsten

---

From: Bjoern Hoehrmann <[email-masked]>
Date: Tue, 12 Mar 2013 12:54:50 +0100

* Paul Hoffman wrote:
>Can you send a pointer to the list of where we can get the ECMAScript v6 
>draft? I found a link to a months-old one, but having an up-to-date one 
>would be useful.

He linked http://people.mozilla.org/~jorendorff/es6-draft.html links to
http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts at
the very top and there in turn you have a 8 Mar 2013 version in .doc and
.pdf.
-- 
Björn Höhrmann · mailto:[email-masked] · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/