Repository navigation
Add C-380: json.to_map holds one entry per key - #141
Merged
Merged
Conversation
…e reference evaluator's json.to_map Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…y fixture Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…l shape Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds C-380 under ALS-C1:
json.to_mapfolds an object's fields into the map one upsert at a time. A repeated key therefore keeps the position of its first occurrence and takes the value of its last, so the map holds it once.The judge side of almide/almide#3700. On wasm today,
json.to_map(value.object([("k", 1), ("k", 2)]))answers["k": "1", "k": "2"]:lenis 2,getreturns the first value, and==against["k": "2"]is false. Native answers["k": "2"].value.stringifytext;none.spec/wasm_cross/json_to_map_duplicate_keys.almdcovers a repeated key, first-position order, mixed non-Str values, ajson.parsed duplicate, an empty object, a non-object, and equality against the deduplicated map.json.to_mapin the evaluator answerednonefor any non-Str value and did not deduplicate. It now follows C-380, and its output on the fixture is byte-identical to almide native (develop 5cbe703c5).--writealso rewrites older rows whose entry commits moved when their PRs were rebase-merged, so that unrelated churn is left out.Gates run locally, all green: check-contracts, contract-provenance, als-element-coverage, als-style, als-validation, links, gate-verification, selftest-conformance, runner-coverage.
The wasm leg of the fixture fails on almide today. That is the defect; the implementation PR follows the pin advance.