Skip to content

Editorial: Extract JSON parsing into its own AO#3540

Merged
ljharb merged 1 commit intotc39:mainfrom
nicolo-ribaudo:ParseJSON
Mar 12, 2025
Merged

Editorial: Extract JSON parsing into its own AO#3540
ljharb merged 1 commit intotc39:mainfrom
nicolo-ribaudo:ParseJSON

Conversation

@nicolo-ribaudo
Copy link
Copy Markdown
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
Comment thread spec.html
<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
Copy Markdown
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
Copy Markdown
Member

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.

Comment thread 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
Copy Markdown
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.

Comment thread spec.html Outdated
Comment thread spec.html Outdated
@bakkot bakkot added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Mar 12, 2025
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