-
Notifications
You must be signed in to change notification settings - Fork 34
Definition of 'prelude steps' for generator function algorithms #86
Comments
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. |
@jorendorff return generator objects or just regular iterators? |
@ljharb Generator objects. I'll be presenting this for discussion at the plenary. |
While writing tests for this proposal I noticed that the descriptions may say, for example:
Shouldn't these then say "%AsyncIterator.prototype%.asIndexedPairs is a built-in function"? |
@devsnek Got it. When can we expect that changeset to land? |
@rwaldron after tc39/ecma262#2045 i think |
#2045 has landed 🥳 |
@jugglinmike this is relevant to your interests! |
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?
The text was updated successfully, but these errors were encountered: