proposal-deiter
proposal-deiter copied to clipboard
How to specify this in the built-in iterators in the specification?
Now in tc39/ecma262#2045, built-in iterators are written by Abstract Closures. In the AC, algorithms can use Let _next_ be ? Yield(_value_) to get the value (equals to const next = yield value in userland).
Now, this proposal says we can use function.sent proposal to resolve that problem in userland, but how to have function.sent equivalent in the specification so the built-in iterators can implement double-ended iterator?
The function.sent proposal (specced by @allenwb) use LastYieldValue to denote that. I suppose Yield abstract operation could update LastYieldValue, and then u just need ?Yield(_value_) and when need use _next_ use LastYieldValue instead.