Intent to ship: JSON ⊂ ECMAScript

34 views
Skip to first unread message

Mathias Bynens

unread,
Feb 16, 2018, 7:15:30 AM2/16/18
to blink-dev, v8-users, richard...@gmail.com

Contact emails

mat...@chromium.org


Spec

https://github.com/tc39/proposal-json-superset


Summary

A Stage 3 proposal makes ECMAScript a syntactic superset of JSON by allowing U+2028 and U+2029 in string literals.


Motivation

ECMAScript claims JSON as a subset in JSON.parse, but (as has been well-documented) that is not true because JSON strings can contain unescaped U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR characters while ECMAScript strings cannot.

These exceptions add unnecessary complexity to the specification and increase the cognitive burden on both implementers and users, allowing for the introduction of subtle bugs. Also, as a lesser but concrete corollary problem, certain source concatenation and construction tasks currently require additional steps to process valid JSON into valid ECMAScript before embedding it.


Interoperability risk

Firefox: Public support

Edge: Public support

Safari: Public support

Web developers: Strongly positive


Compatibility risk

This change is backwards-compatible. User-visible effects will be limited to the elimination of SyntaxError completions when parsing strings that include unescaped LINE SEPARATOR or PARAGRAPH SEPARATOR characters, which in practice are uncommon.


Is this feature fully tested?

Yes; see v8/test/cctest/test-parsing/LineOrParagraphSeparator{AsLineTerminator,InStringLiteral,InStringLiteralHarmony}.


Tracking bug

https://bugs.chromium.org/p/v8/issues/detail?id=7418


Link to entry on the Chrome Platform Status dashboard

https://www.chromestatus.com/features/6102319234023424


Requesting approval to ship?

Yes

PhistucK

unread,
Feb 16, 2018, 7:51:09 AM2/16/18
to Mathias Bynens, blink-dev, v8-users, richard...@gmail.com
(At least on blink-dev)
"Interoperability risk" should have links for citing each vendor and web developer support.


PhistucK

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJYpFjDOzdTHBNJR0oheBPOtKCETJQUxPqd3pYCz3DA8%3DGKRTg%40mail.gmail.com.

Mathias Bynens

unread,
Feb 16, 2018, 8:08:06 AM2/16/18
to PhistucK, Mathias Bynens, blink-dev, v8-users, richard...@gmail.com
Note that since this is a V8/JS feature, this post is just an FYI to blink-dev — no signoff from Blink API owners is required.

For ECMAScript features like this one, if a browser vendor would be opposed to this proposal, they would block its advancement at TC39. Given that this proposal already made it to Stage 3 I would be surprised if vendors would suddenly change their mind now.

PhistucK

unread,
Feb 16, 2018, 8:25:01 AM2/16/18
to Mathias Bynens, Mathias Bynens, blink-dev, v8-users, richard...@gmail.com
I know.

Regarding "public support" - not "opposed" does not necessarily mean "support" (it could be neutral). Transparency is important in chromestatus.com (and in intent, I would argue).
Second, web developers are not part of the TC39 stages, so support or reactions from them are not a given (not as far as "strongly positive").
I think it makes sense to add links for opinions that are not your own.

Just my two or three cents.


PhistucK

Sathya Gunasekaran

unread,
Feb 16, 2018, 1:57:46 PM2/16/18
to v8-users, Mathias Bynens, Mathias Bynens, blink-dev, richard...@gmail.com
LGTM
>>>> an email to blink-dev+...@chromium.org.
> --
> --
> v8-users mailing list
> v8-u...@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to v8-users+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Benedikt Meurer

unread,
Feb 16, 2018, 1:58:39 PM2/16/18
to v8-u...@googlegroups.com, Mathias Bynens, Mathias Bynens, blink-dev, richard...@gmail.com
LGTM!
--



 •  Benedikt Meurer
 •  Google Germany GmbH
 •  Erika-Mann-Str. 33
 •  80636 Munich
 •  bme...@google.com


Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg

Diese E-Mail ist vertraulich. Wenn Sie nicht der richtige Adressat sind, leiten Sie diese bitte nicht weiter, informieren Sie den Absender und löschen Sie die E-Mail und alle Anhänge. Vielen Dank. This e-mail is confidential. If you are not the right addressee please do not forward it, please inform the sender, and please erase this e-mail including any attachments. Thanks.

Mathias Bynens

unread,
Feb 17, 2018, 3:02:12 AM2/17/18
to Benedikt Meurer, v8-users, Mathias Bynens, blink-dev, richard...@gmail.com
For future reference: this landed in V8 v6.6.257 and should thus be available in Chrome 66.

LGTM!



>>>> To view this discussion on the web visit
>>>> https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAJYpFjDOzdTHBNJR0oheBPOtKCETJQUxPqd3pYCz3DA8%3DGKRTg%40mail.gmail.com.
>>>
>>>
>>
>
> --
> --
> v8-users mailing list
> v8-u...@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an

> For more options, visit https://groups.google.com/d/optout.

--
--
v8-users mailing list
v8-u...@googlegroups.com
http://groups.google.com/group/v8-users
---
You received this message because you are subscribed to the Google Groups "v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages