Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Definition of 'prelude steps' for generator function algorithms #86

Closed
avandolder opened this issue May 14, 2020 · 11 comments · Fixed by #112
Closed

Definition of 'prelude steps' for generator function algorithms #86

avandolder opened this issue May 14, 2020 · 11 comments · Fixed by #112
Milestone

Comments

@avandolder
Copy link
Contributor

Currently, the algorithms for the proposed helpers that use generator functions are split into prelude steps and body steps. It is my understanding that this is to allow for the checks in the prelude to be done eagerly when the helper is first called, regardless of when the generator is consumed. However, this distinction between prelude and body steps is not defined in the Algorithms Conventions section of ECMA 262.
As a result, should such a definition be added into this proposal?

@jorendorff
Copy link
Collaborator

Per some discussion with @devsnek, I think the current idea is for the helper methods themselves to be plain builtin functions which return generator objects. That solves the problem with how to make the prelude steps happen early.

We'll see what TC39 has to say about this at the upcoming meeting.

@devsnek
Copy link
Member

devsnek commented May 22, 2020

Sorry for not noticing this issue. What I'm working with at the moment looks like this:

I'm hoping it is the final iteration but I'm not sure, as Jason says we will be discussing it during the upcoming plenary.

@ljharb
Copy link
Member

ljharb commented May 22, 2020

@jorendorff return generator objects or just regular iterators?

@devsnek devsnek added this to the Stage 3 milestone May 22, 2020
@devsnek
Copy link
Member

devsnek commented May 28, 2020

cc @michaelficarra @decompil3d

@jorendorff
Copy link
Collaborator

@ljharb Generator objects. I'll be presenting this for discussion at the plenary.

@rwaldron
Copy link

rwaldron commented Nov 3, 2020

While writing tests for this proposal I noticed that the descriptions may say, for example:

%AsyncIterator.prototype%.asIndexedPairs is a built-in async generator function

Shouldn't these then say "%AsyncIterator.prototype%.asIndexedPairs is a built-in function"?

@devsnek
Copy link
Member

devsnek commented Nov 3, 2020

@rwaldron the current spec text is very old, check out #112

@rwaldron
Copy link

rwaldron commented Nov 3, 2020

@devsnek Got it. When can we expect that changeset to land?

@devsnek
Copy link
Member

devsnek commented Nov 3, 2020

@rwaldron after tc39/ecma262#2045 i think

@Jack-Works
Copy link
Member

#2045 has landed 🥳

@rwaldron
Copy link

rwaldron commented Feb 4, 2021

@jugglinmike this is relevant to your interests!

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

Successfully merging a pull request may close this issue.

6 participants