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
Generator.prototype.next bug (resolved, non-issue) #254
Comments
I found what I think is a problem with generator.prototype.next() and yield, the code below explains my problem: Generator function
Code one (logical code, but does not work)
Output
The workaround (I think the logic is twisted [no insult])
Output (desired result)
Why was the variable rv (in line 2) in the generator function set only after the next yield (in line 4) was called?
(everything is in logical order this way) In my opinion, when the state is SUSPENDEDSTART just like SUSPENDEDYIELD the value passed to generator.prototype.next() as in next(arg), should not be discarded, it solves that nasty problem. |
This is not a bug in regenerator, this is how generators currently work in JS. That's the reason for the proposal of
|
Thanks, I tried to do the same with Python, and I realized that Python uses On Monday, July 25, 2016, Felix Kling notifications@github.com wrote:
|
Thanks for digging into this. |
comment deleted, see the next comment
The text was updated successfully, but these errors were encountered: