ReviewOS

zig-utils/zig-js

Runtime: add realm-owned process EventEmitter semantics

#240
Closed chris opened this 11 days ago ·
11 days ago

Parent: #239

Add the selected-realm process object and the EventEmitter behavior required by Bun private ABI handlers.

Acceptance:

  • Provide on/addListener, once, off/removeListener, emit, listenerCount, and uncaught-exception capture callback accessors.
  • Match listener registration order, duplicate listeners, once-before-call removal, snapshot iteration under reentrant add/remove, receiver/arguments, return values, and thrown-listener propagation.
  • Keep listeners and capture callbacks precisely rooted, realm-local, hidden from ordinary reflection, and isolated across sibling globals.
  • Add focused normal/no-GIL/leak coverage and document the foundation without claiming warning/rejection handlers complete.
11 days ago

Implemented and pushed to main in 95756af7. The realm-owned process emitter now covers aliases, duplicate/newest removal, FIFO snapshot/reentrancy, once-before-call, receiver/argument identity, thrown propagation, Symbol events, capture callback accessors, unhandled error, precise hidden-slot rooting, and realm isolation. Focused runtime gate: 3/3 passed, 0 leaked.

Sign in to comment on this issue.