Maybe we should just make U+2028 and U+2029 valid in JS then? What other
productions in JSON are invalid syntax in JS?

On Thursday, 29 September 2016, Mike Samuel <[email protected]> wrote:

> On Thu, Sep 29, 2016 at 8:45 AM, Oriol Bugzilla
> <[email protected] <javascript:;>> wrote:
> >> ECMAScript, while highly used in web browsers, should really not care
> >> about HTML constructs. That's where WHATWG and W3C come in. I suggest
> this
> >> type of feature should come from one of those groups, not ECMA.
> >
> > That applies to escaping things like `</script>` or `]]>`, and I agree.
> But
> > as Mike Samuel mentioned, JSON strings containing U+2028 or U+2029 are
> not
> > valid JS expressions. I think it would make sense for `JSON.stringify` to
> > escape these.
>
> What is it that you're saying is not in TC-39's bailiwick?
>
> Is it that w3c/whatwg should define what constitutes "embeddable JSON"?
>
> Or is it that if it's worth defining a function that produces
> embeddable JSON from an EcmaScript object, that w3c/whatwg should
> include that in some set of EcmaScript APIs that it defines?
>
> If you agree with my earlier claim
> """
> We're talking about JSON serializers.  Every serializers produces
> a subset of the output language. Choices about that sublanguage affect
> how easy/hard it is to use that serializer with other tools.
> """
> then it seems that TC-39 might take embeddability into account when
> crafting the subset of JSON that JSON.stringify produces.
> _______________________________________________
> es-discuss mailing list
> [email protected] <javascript:;>
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to