Skip to content

ABI: implement exact iterable callback traversal #237

Description

@chrisbbreuer

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

Implement the pinned JSC__JSValue__forEach private-ABI boundary as a real iterator-protocol traversal with a native callback per yielded value.

Acceptance

  • Perform exact GetMethod(value, @@iterator), iterator creation, cached next lookup, IteratorStep, and IteratorValue ordering for arrays, strings, Map/Set, generators, and custom iterables.
  • Invoke the native callback once per yielded value with the selected global, VM identity, opaque callback context, and stable EncodedJSValue identity.
  • Preserve getter/proxy/custom-iterator observability and stop on abrupt completion; close an open iterator when the callback publishes an exception, retaining the original first-wins exception if return() also throws.
  • Accept same-VM sibling values, reject foreign-VM handles, and leave an already-pending exception untouched without advancing the iterable.
  • Add focused normal/leak coverage and the pinned consumer compile-link-runtime fixture.
  • Update generated Home/Bun inventories, README/docs counts, and all parent issue evidence from committed artifacts.

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