Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify USV handling in "serialize a JavaScript value to JSON bytes" #536

Open
Ms2ger opened this issue Feb 13, 2023 · 1 comment
Open
Labels
clarification Standard could be clearer

Comments

@Ms2ger
Copy link
Member

Ms2ger commented Feb 13, 2023

"serialize a JavaScript value to JSON bytes" implicitly treats a "string" as a "scalar value string" (in fact, an "I/O queue"), without mentioning how to handle unpaired surrogates.

Fortunately, ECMAScript guarantees that JSON.stringify will return a scalar value string, but that took a moment to verify. It would be nice to see this spelled out in Infra.

@annevk
Copy link
Member

annevk commented Feb 13, 2023

I suppose we should update the assert in step 3 of https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string? And then maybe add a note below it that it a JSON string might still contain escaped surrogates?

@annevk annevk added the clarification Standard could be clearer label Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer
Development

No branches or pull requests

2 participants