ReviewOS

zig-utils/zig-js

ABI: implement exact private class and display names

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

Goal

Implement the shared pinned Home/Bun private class and display-name projection cluster:

  • JSC__JSValue__getClassInfoName
  • JSC__JSValue__getClassName
  • JSC__JSValue__getNameProperty
  • JSC__JSValue__getName

Parent: #134 Profile umbrella: #140 Home profile: #163 Bun profile: #164

Acceptance criteria

  • getClassInfoName exposes the exact static class-info name and length only for valid owned cells, with a stable borrowed lifetime and untouched outputs on failure.
  • getNameProperty performs one observable @@toStringTag read, accepts only a non-empty string tag, then applies the pinned JavaScript/internal-function name fallbacks.
  • getClassName rejects non-objects, delegates empty/Function raw class names to the name-property path, and otherwise preserves calculated-class-name before raw-class fallback.
  • getName uses calculated display names first, then the pinned @@toStringTag fallback, returning the exact owned BunString representation.
  • Accessors, proxies, Symbols/non-string tags, anonymous/named/native/bound/class functions, built-ins, ordinary objects, and spoofed user properties have focused coverage.
  • Same-VM sibling realms, foreign cells, invalid encodings, abrupt completion, output initialization, ownership, and first-pending-exception behavior are deterministic.
  • The combined private ABI consumer fixture links and exercises all four exports.
  • Home/Bun inventories, ABI documentation, parent trackers, and README counts are updated from committed evidence.
  • Focused tests and the relevant batched ABI audits pass before closure.

Pinned reference

Bun revision 4982b91e, src/jsc/bindings/bindings.cpp, functions JSC__JSValue__getClassInfoName, JSC__JSValue__getClassName, JSC__JSValue__getNameProperty, and JSC__JSValue__getName.

Completion evidence

  • Code: f9c14bc9 — four exact projections, stable class-info metadata, calculated names, observable/VM-inquiry tag paths, borrowed ZigString views, and owned Latin-1/UTF-16 BunString output.
  • Documentation: 5732c29b — README, ABI, API, and Home integration evidence/counts.
  • Focused test: 3/3 passed, 0 skipped, 0 failed, 0 leaked.
  • Batched ABI gate: Home 210/431 implemented (221 pending), Bun 204/421 implemented (217 pending), public C 117/117 plus 214 private/support exports.
  • Consumer fixture: 209/209 symbols linked and the runtime matrix passed.
  • Benchmark report remains the isolated 1,540-sample artifact at 36a617b3; this ABI-only slice did not regenerate performance scores.
9 days ago

Completed on main in f9c14bc with documentation/evidence in 5732c29. Focused tests passed 3/3 with zero leaks; Home/Bun/public audits and the 209/209 consumer fixture are green.

Sign in to comment on this issue.