You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.
Right now the current way the spec is phrased makes it impossible to polyfill/implement the proposal in JS as a for-of loop. Since you'd like to do something like:
still doesn't work because it pumps the iterator once before checking if the callback is callable. Could we change the spec to move the Let iterated be ? [GetIteratorDirect](https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect)(this value). line of each method next to the appropriate Let next be ? [IteratorStep](https://tc39.es/ecma262/#sec-iteratorstep)(iterated). line?
The text was updated successfully, but these errors were encountered:
Hm, yeah. I also think it would be more consistent with the rest of the spec to do all of the validation (of this and the arguments) before we start reading from this. I agree we should change these.
I should note that it even with this tweak it's non-trivial to polyfill with a for-of because iterator helpers use this.next directly, rather than using this[Symbol.iterator]().next as a for-of would.
Right now the current way the spec is phrased makes it impossible to polyfill/implement the proposal in JS as a
for-of
loop. Since you'd like to do something like:but the current spec prohibits such an implementation because it opens the iterator before checking for is callable and doing something like:
still doesn't work because it pumps the iterator once before checking if the callback is callable. Could we change the spec to move the
Let iterated be ? [GetIteratorDirect](https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect)(this value).
line of each method next to the appropriateLet next be ? [IteratorStep](https://tc39.es/ecma262/#sec-iteratorstep)(iterated).
line?The text was updated successfully, but these errors were encountered: