Skip to content

ABI: implement Bun process warnings and rejection event hooks #239

Description

@chrisbbreuer

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

Build the process-warning/event foundation required to implement Bun's pending unhandled-rejection and uncaught-exception private ABI as observable runtime behavior rather than isolated no-ops.

Scope

  • Bun__Process__emitWarning
  • Bun__promises__emitUnhandledRejectionWarning
  • Bun__emitHandledPromiseEvent
  • Bun__handleUnhandledRejection
  • Bun__handleUncaughtException
  • Bun__wrapUnhandledRejectionErrorForUncaughtException
  • the directly required Process__dispatch* event hooks

Acceptance

  • Add a selected-realm process event/warning model with listener ordering, once/removal behavior, exact arguments, and reentrant mutation semantics needed by the pinned consumers.
  • Reproduce Bun's two-warning unhandled-rejection path, including own-stack classification, throwing stack access, pure fallback stringification, warning name/stack descriptors, and exception clearing between emissions.
  • Implement handled/unhandled rejection and uncaught-exception return codes, capture-callback precedence, monitor/listener ordering, origin strings, and fatal fallback boundaries.
  • Preserve Promise/reason identity, sibling-VM behavior, first-pending exceptions, and deterministic behavior when listeners throw.
  • Add focused runtime/differential fixtures and update both pinned inventories, README/docs evidence, and parent issues from committed artifacts.

This issue is intentionally a cluster: none of these exports should be counted complete until their shared process event semantics exist.

Child issues

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions