ReviewOS

zig-utils/zig-js

C API: implement remaining ordinary object constructors and property APIs

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

Parents: #135, #134 Class/name-array dependency: #137

Complete the non-JSClass portions of JSObjectRef.h.

Acceptance:

  • Implement Date, Error, RegExp, dynamic Function, and callback constructor creation.
  • Implement get/set prototype through real internal methods, including Proxy invariants and cycle rejection.
  • Implement inherited string-name has and string-name delete with attributes/Proxy behavior.
  • Implement Symbol-aware has/get/delete by property key with ToPropertyKey and exception propagation.
  • Implement set-by-property-key with attributes through the correct callback/Proxy path.
  • Implement indexed writes through [[Set]].
  • Implement property-name snapshot creation (array/accumulator lifecycle remains shared with #137).
  • Complete C compile-link-runtime coverage for constructors, proxy/accessor throws, symbols, and enumeration.

Progress

  • 5d7a98c exposes prototype get/set, inherited string-property queries, string deletion, and indexed writes through the interpreter's existing essential-internal-method funnels rather than bypassing Proxy/accessor/typed-array rules.

  • Real C/C++ hosts pass. The pinned system-JSC differential now matches 8/8 rows (a774d6de5acfc47c).

  • Matrix after 5d7a98c: 94/117 complete, 23 pending; 95 public functions and 9 zig-js extensions present.

  • 89bf90a adds Symbol/string ToPropertyKey query, get, and delete with throwing conversion/Proxy propagation. C/C++ hosts pass; the system-JSC differential is 9/9 (7ba94cd7a5527301). Matrix: 97/117 complete, 20 pending; 98 public functions and 9 extensions present.

  • 296ef71 completes the slice: intrinsic Date/Error/RegExp/dynamic-Function construction survives mutable global replacement; function names/source and syntax metadata are preserved; set-by-key performs exact-once ToPropertyKey with Symbol/numeric/throwing keys, attributes, and internal-method dispatch. Property-name snapshots landed with #137. Audit: 110/117 complete, 7 pending, 110 public exports + 9 extensions. C/C++ hosts pass; system-JSC differential matches 31/31 rows (af4c21263b55fd7b).

9 days ago

Completed on main in 296ef71. All acceptance items are checked; focused constructor/property-key tests, C/C++ hosts, and the 31-row system-JSC differential pass.

Sign in to comment on this issue.