proposal-iterator-helpers
proposal-iterator-helpers copied to clipboard
Methods for working with iterators in ECMAScript
Fixes #115. Option 2: just make `@@toStringTag` writable.
Fixes #207. Adds "counter" parameters to callbacks of methods that have an `Array.prototype` analogue that passes an index to its callback. Also removes `.indexed()` now that it's equivalent to `.map((a,...
In plenary, some argued for passing a second index parameter to the `Array.prototype`-like methods' callbacks. I'm not entirely opposed to this but I'm unconvinced at the moment that this is...
#172 made me realize that this proposal introduces 2 new hidden intrinsics for the wrapper prototypes, aka that are only discoverable by calling the `Iterator.from` and `AsyncIterator.from` methods with well...
**Firefox** ran into [Bug 1644581](https://bugzilla.mozilla.org/show_bug.cgi?id=1644581) when the `%Symbol.toStringTag%` property was added to `%Iterator.prototype%` as non‑writable. There was also no attempt to add a `%Symbol.toStringTag%` property to `%AsyncIterator.prototype%` afterwards, which is ...
One challenge I have found with using async iteration is that it is challenging to do basic functionality like `map` in a way that works properly with `return`/`throw`. For example,...
Fixes #229. **update:** Now also fixes #237, aligning `flatMap` and `from`. ### `Iterator.prototype.flatMap` and `Iterator.from`: * non-Object: throw * has `Symbol.iterator`: call it, get sync iterator, iterate * has callable...
Fixes #230. This is only observable in the number of ticks taken to complete the method. It is always at least 1 because the async iteration protocol itself requires awaiting...
As mentioned by @rbuckton in https://github.com/tc39/proposal-iterator-helpers/issues/117#issuecomment-1238559467. Also it was questioned whether `true`/`false` should be the fast path or truthy/falsey non-thenables. I would only support `true`/`false`.
If you have an object `{ next() {...} }`, and it doesn't have a `Symbol.iterator` or `Symbol.asyncIterator` method, there's no way to tell if that's _sync_ or _async_. If you...