src/third_party/mozjs/extract/js/src/builtin/AsyncIteration.js
/* Iterator Helpers proposal 2.1.6.4 Prelude */
Iterator Helpers proposal 2.1.6.4 Prelude
Iterator Helpers proposal 2 . 1 . 6 . 4 Prelude
function AsyncIteratorTake(limit) {
  const iterated = GetIteratorDirect(this);
  const remaining = ToInteger(limit);
  if (remaining < 0) {
    ThrowRangeError(JSMSG_NEGATIVE_LIMIT);
  }
  const iteratorHelper = NewAsyncIteratorHelper();
  const generator = AsyncIteratorTakeGenerator(iterated, remaining);
  callFunction(IntrinsicAsyncGeneratorNext, generator);
  UnsafeSetReservedSlot(iteratorHelper, ASYNC_ITERATOR_HELPER_GENERATOR_SLOT, generator);
  return iteratorHelper;
}
function AsyncIteratorTake ( limit ) { const iterated = GetIteratorDirect ( this ) ; const remaining = ToInteger ( limit ) ; if ( remaining < 0 ) { ThrowRangeError ( JSMSG_NEGATIVE_LIMIT ) ; } const iteratorHelper = NewAsyncIteratorHelper ( ) ; const generator = AsyncIteratorTakeGenerator ( iterated , remaining ) ; callFunction ( IntrinsicAsyncGeneratorNext , generator ) ; UnsafeSetReservedSlot ( iteratorHelper , ASYNC_ITERATOR_HELPER_GENERATOR_SLOT , generator ) ; return iteratorHelper ; }
Iterator Helpers proposal 2.1.6.4 Prelude
Iterator Helpers proposal 2 . 1 . 6 . 4 Prelude
// Step 1. // Step 2. // Step 3.