proposal-deiter icon indicating copy to clipboard operation
proposal-deiter copied to clipboard

How to specify this in the built-in iterators in the specification?

Open Jack-Works opened this issue 5 years ago • 1 comments

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?

Jack-Works avatar Sep 18 '20 04:09 Jack-Works

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.

hax avatar Sep 18 '20 05:09 hax