Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Jack-Works opened this issue Sep 18, 2020 · 1 comment
Open

Comments

@Jack-Works
Copy link
Member

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?

@hax
Copy link
Member

hax commented Sep 18, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants