Skip to content

Editorial: Extract JSON parsing into its own AO #3540

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

Merged
merged 1 commit into from
Mar 12, 2025

Conversation

nicolo-ribaudo
Copy link
Member

Ref #3538 / #3391 (comment). I'm also going to use this AO in ECMA-426.

@nicolo-ribaudo nicolo-ribaudo changed the title Extract JSON parsing into its own AO Editorial: Extract JSON parsing into its own AO Feb 19, 2025
spec.html Outdated
<dl class="header">
</dl>
<emu-alg>
1. [id="step-json-parse-validate"] If StringToCodePoints(_text_) is not a valid JSON text as specified in ECMA-404, throw a *SyntaxError* exception.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to reword this step otherwise ecmarkup was complaining that this AO can never return an abrupt completion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's arguably a bug in ecmarkup, but I like this wording better anyway.

spec.html Outdated
Comment on lines 46202 to 46205
<p>It is not permitted for a conforming implementation of `JSON.parse` to extend the JSON grammars. If an implementation wishes to support a modified or extended JSON interchange format it must do so by defining a different parse function.</p>
<emu-note>
<p>In the case where there are duplicate name Strings within an object, lexically preceding values for the same key shall be overwritten.</p>
</emu-note>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved these two sentences from InternalizeJSONProperty to here, since they didn't really make sense there.

@bakkot bakkot added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Mar 12, 2025
@ljharb ljharb merged commit 53a42e6 into tc39:main Mar 12, 2025
7 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the ParseJSON branch March 12, 2025 22:44
@linusg linusg mentioned this pull request Apr 4, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial change ready to merge Editors believe this PR needs no further reviews, and is ready to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants