Currently we resolve push results to the value passed to next. However, the repeater implementation is off-by-one in the sense that the first push call resolves to the first value passed to next, the second push to the second value and so on. This behavior differs from generators, which will resume yield with the value passed to the next call to next, dropping the first value passed to next entirely. To mimic async generators, we should be resolving the first push to the second value passed to next, and so on.
Currently we resolve
push
results to the value passed tonext
. However, the repeater implementation is off-by-one in the sense that the firstpush
call resolves to the first value passed tonext
, the secondpush
to the second value and so on. This behavior differs from generators, which will resume yield with the value passed to the next call tonext
, dropping the first value passed tonext
entirely. To mimic async generators, we should be resolving the firstpush
to the second value passed tonext
, and so on.In other words, the following test is wrong:
The correct version of this test should be: