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

Tests for proposal-well-formed-stringify #1787

Merged
merged 8 commits into from Oct 3, 2018

Conversation

Projects
None yet
4 participants
@gibson042
Copy link
Contributor

gibson042 commented Sep 24, 2018

https://github.com/tc39/proposal-well-formed-stringify

Prevent JSON.stringify from returning ill-formed Unicode strings.

Includes moderate refactoring of other JSON.stringify tests, which can be separated out upon request.

@gibson042 gibson042 force-pushed the gibson042:proposal-well-formed-stringify branch from abec281 to 3e020dd Sep 24, 2018

@mathiasbynens

This comment has been minimized.

Copy link
Member

mathiasbynens commented Sep 29, 2018

The proposal advanced to stage 3 at the September 2018 TC39 meeting. Please remove the “awaiting stage 3” label.

@@ -3,11 +3,15 @@

/*---
es5id: 15.12.3_4-1-2
description: JSON.stringify a circular object throws a TypeError
description: JSON.stringify a indirectly circular object throws a error

This comment has been minimized.

@mathiasbynens

This comment has been minimized.

@mathiasbynens

mathiasbynens Sep 29, 2018

Member

2×, i.e.

JSON.stringify on an indirectly circular object throws an error
var char_to_json = {
'"': '\\"',
"\\": "\\\\",
"\x00": "\\u0000",

This comment has been minimized.

@mathiasbynens

mathiasbynens Sep 29, 2018

Member

\x00 could be \0 (it’s not an octal escape sequence)

This comment has been minimized.

@gibson042

gibson042 Sep 29, 2018

Contributor

I addressed the grammar nits, but left this \x00 for internal consistency with the following properties.

This comment has been minimized.

@mathiasbynens

mathiasbynens Oct 1, 2018

Member

That's fine. It was either the preceding property (\\) or the following ones.

@mathiasbynens
Copy link
Member

mathiasbynens left a comment

LGTM!

Left some comments with minor nits.

@mathiasbynens

This comment has been minimized.

Copy link
Member

mathiasbynens commented Oct 1, 2018

This seems good to go. @rwaldron @leobalter Would it be possible to prioritize this PR over others please? V8 is looking to ship this and we'd like to wait until there are official (and merged) Test262 tests.

@rwaldron rwaldron merged commit e064fcd into tc39:master Oct 3, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment