Skip to content

update spec, readme to options bag approach - #11

Open
peetklecha wants to merge 6 commits into
mainfrom
options-bag
Open

update spec, readme to options bag approach#11
peetklecha wants to merge 6 commits into
mainfrom
options-bag

Conversation

@peetklecha

Copy link
Copy Markdown
Member

No description provided.

@peetklecha
peetklecha requested a review from acutmore July 28, 2026 15:31
Comment thread index.html
Comment thread spec.emu
1. Else,
1. Return _unfiltered_.
1. Let _jsonString_ be ? ToString(_text_).
1. <ins>Let _options_ be CreateJSONParseOptionsRecord(_reviver_)</ins>.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
1. <ins>Let _options_ be CreateJSONParseOptionsRecord(_reviver_)</ins>.
1. <ins>Let _options_ be CreateJSONParseOptions(_reviver_)</ins>.

Comment thread spec.emu
1. Let _preferNullPrototypeChoice_ be *undefined*.
1. If _options_ ? <emu-meta suppress-effects="user-code">HasProperty(_options_, *"freeze"*)</emu-meta>, then
1. Let _freezeChoice_ be ? <emu-meta suppress-effects="user-code">Get(_options_, *"freeze"*)</emu-meta>.
1. If _freezeChoice_ is not a Boolean and _freezeChoice_ is not *undefined*, throw a *TypeError* exception.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think the more general convention for boolean options is to coerce https://github.com/tc39/how-we-work/blob/main/normative-conventions.md#avoid-coercing-arguments-to-types-other-than-boolean

This is also what Temporal does for options, it calls ToBoolean: https://tc39.es/proposal-temporal/#sec-getoption

Comment thread spec.emu
</emu-alg>
<p>This function is the <dfn>%JSONParseImmutable%</dfn> intrinsic object.</p>
<p>The *"length"* property of the `parseImmutable` function is 2.</p>
<emu-table id="table-json-parse-options-records" caption="JSON Parse Options Record Fields">

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This section should be in a emu-cause that defines a "JSON Parse Options Record". That way the other parts of the spec that say that return or take this type can properly reference it.

Example for reference:https://github.com/tc39/proposal-composites/blob/d667368b05fbc11b60e678ca13b7b0b394bcc8be/spec.emu#L177-L181

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants