ReviewOS

zig-utils/zig-js

ABI: implement value-key property query and BunString upsert

#370
Closed chris opened this 9 days ago ·
9 days ago

Parent: #134 Related: #140, #163, #164

Implement the three shared private JSValue property operations used by pinned Home and Bun.

Acceptance:

  • JSC__JSValue__hasOwnPropertyValue performs observable ToPropertyKey once and exact own-property inquiry, including Symbols, indexed exotics, proxies, and exception publication.
  • JSC__JSValue__putBunString converts every valid BunString key and performs direct own data-property replacement without invoking prototype setters.
  • JSC__JSValue__upsertBunStringArray stores a missing value directly, replaces an existing scalar with [old, new], pushes into an existing real array, and returns encoded undefined.
  • Reject invalid/foreign values safely while retaining first-exception behavior and selected-VM identity.
  • Add focused engine and compiled Home/Bun consumer evidence in Debug and ReleaseSafe.
  • Refresh inventories/docs and parent issue evidence.
9 days ago

Implementation is in progress locally. Debug evidence is green so far: focused engine 3/3 with zero leaks, Home consumer 346/346, and the Bun compiled property fixture passes. Generated inventories resolve to Home 359/471 (112 pending) and Bun 351/461 (110 pending), zero unclassified. ReleaseSafe, docs, and the final small commit/push remain before closure.

9 days ago

Implemented and pushed directly to main in 01b3aef3.

Evidence:

  • exact three pinned exports compile and link from Home and Bun declarations;
  • value-key own inquiry performs one observable ToPropertyKey and preserves string/Symbol/index/proxy behavior;
  • direct BunString writes bypass inherited setters and replace configurable own accessors;
  • upsert preserves missing → scalar, scalar → [old, new], and existing-array push behavior, returning encoded undefined;
  • invalid and foreign values publish TypeError without partial mutation; pre-existing exceptions remain first-wins;
  • focused Debug and ReleaseSafe: 3/3, zero leaks;
  • Home compiled consumer: 346/346 in Debug and ReleaseSafe;
  • Bun-profiled compiled fixture passes in Debug and ReleaseSafe;
  • inventories: Home 359/471 implemented (112 pending), Bun 351/461 (110 pending), zero unclassified.

Sign in to comment on this issue.