makeRefIterator = iteratorRef => {
  const iterator = {
    /** @param {[] | [TNext]} args */
    next: async (...args) => E(iteratorRef).next(...args),
    /** @param {[] | [TReturn]} args */
    return: async (...args) => E(iteratorRef).return(...args),
    /** @param {any} error */
    throw: async error => E(iteratorRef).throw(error),
    [Symbol.asyncIterator]: () => iterator,
  };
  return iterator;
}
@template TValue
@template TReturn
@template TNext
@param {import('@endo/far').ERef<AsyncIterator<TValue, TReturn, TNext>>} iteratorRef