ReviewOS

zig-utils/zig-js

ABI: implement exact unhandled-rejection error-like classification

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

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

Implement the pinned Bun__promises__isErrorLike private-ABI boundary used to classify unhandled rejection reasons.

Acceptance

  • Return true only for JavaScript objects carrying an own stack property, whether data or accessor; inherited-only properties and primitives return false.
  • Match Object.prototype.hasOwnProperty observability for proxies: run [[GetOwnProperty]] exactly once, honor its invariants, and publish thrown/revoked-proxy failures through the VM pending-exception boundary.
  • Do not invoke an own accessor getter merely to detect its descriptor.
  • Accept values from sibling globals in the same VM, reject foreign-VM handles deterministically, and preserve an already-pending exception as first-wins state.
  • Add focused normal, no-GIL, and leak verification plus the pinned consumer compile/link/runtime fixture.
  • Update generated ABI inventories, README/docs counts, and parent issue evidence from committed artifacts.
9 days ago

Completed on main in three intentionally small commits: implementation and focused coverage at 34868ea0, the combined-fixture scope correction at 60e63239, and generated inventory/README documentation at 8f85d6be.

Evidence:

  • exact own-stack descriptor semantics for data/accessor properties, inherited-only rejection, and primitive rejection
  • one observable Proxy [[GetOwnProperty]] operation with revoked/throwing abrupt completion published through the VM pending-exception boundary
  • same-VM sibling acceptance, foreign-VM rejection, and first-pending preservation
  • focused unit matrix: 3/3 passed, 0 leaked
  • pinned consumer fixture: 228/228 symbols linked; runtime matrix passed
  • Home audit: 229/431 implemented, 202 pending, 0 unclassified
  • Bun core audit: 223/421 implemented, 198 pending, 0 unclassified
  • public classification: 117 public, 19 extensions, 233 private/support exports

The committed 1,540-sample JSC benchmark artifact remains 36a617b3; this ABI-only slice did not regenerate performance scores.

Sign in to comment on this issue.