-
Notifications
You must be signed in to change notification settings - Fork 2
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
Editorial: return ~unused~ from closures passed to GeneratorStart #30
Conversation
9b25244
to
627283a
Compare
I would prefer to go the other direction, as in tc39/ecma262#2924, and ensure that the abstract closures passed to GeneratorStart can only ever return return completions or throw completions. |
You want these to all be |
I want I think it's more natural this way: the only reason normal completions arise when evaluating syntactic generators is the implicit return from running off the end of a function body, which is why their |
Yes but these are synthetic generators we're talking about here, not syntactic generators, and I'd prefer the AC to not have to provide a meaningful return value when they want to cease yielding values. |
I think that GeneratorStart should not have any logic which is specific to dealing with the oddities of syntactic implicit returns, which it currently does (that's what the normal completion case is). And there is necessarily some value which goes in the |
If you want to say that no built-in generators can ever have non- |
Yes, I think that is fine to say. It is going to be |
GeneratorStart step 4.i.i ignores the value returned by the AC, so return
~unused~
instead of*undefined*
to be less confusing.