Goal
Implement the exact pinned Home/Bun private-JSC record/object construction boundary for:
JSC__JSValue__putRecordJSC__JSValue__fromEntries
This is a child of #134, #140, #163, and #164.
Required semantics
JSC__JSValue__putRecord
- Decode the target in the selected VM and reject invalid/foreign targets deterministically.
- Decode the key and every value from all supported ZigString encodings without observable JavaScript coercion.
- Preserve the pinned cardinality rule: zero values creates an empty array, one value creates a scalar string, and multiple values create an ordered string array.
- Define a direct own data property with writable, enumerable, and configurable attributes, bypassing inherited setters.
- Replace an existing own property with the exact constructed value.
- Publish abrupt completion, allocation failure, and pre-existing pending exceptions through the shared first-wins exception boundary.
JSC__JSValue__fromEntries
- Construct an ordinary selected-realm object with
Object.prototype, including the zero-entry case. - Decode keys and values from all supported ZigString encodings without invoking JavaScript.
- Preserve insertion order, duplicate-key last-value behavior, and ECMAScript integer-index enumeration ordering.
- Match the pinned
clone=falseandclone=trueownership/lifetime behavior. - Handle null pointers, count/capacity overflow, and allocation failure without partial observable results.
- Publish failures through the shared first-wins exception boundary.
Completion evidence
- Add focused behavioral tests for both exports, including Latin-1/UTF-8/UTF-16 strings, duplicates, numeric keys, inherited setters, cardinalities, realm/VM rejection, pending exceptions, and allocation cleanup.
- Add both symbols to the pinned Home/Bun inventories and the linkable private-value fixture.
- Keep public/private export classification at zero unclassified symbols.
- Run the focused test first, then one batched Home/Bun/public ABI audit.
- Update the README and compatibility documentation with exact counts and evidence.
- Close this issue only after the implementation and documentation commits are on
origin/main.