-
Notifications
You must be signed in to change notification settings - Fork 300
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
生成器函数第二次执行有问题 #784
Comments
这段代码貌似是在 cli 中运行会不一致,我在脚本里运行结果是一样的。同时这段代码,在 0.37 和 0.38-dev cli 中的行为也不同。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
上述代码执行 gen.next() 后,结果是正确的。但如果再次执行 gen = test(); 结果就不对了,生成器函数成了普通函数,还没等 gen.next() 就立即执行了,而且 yield 等待也没生效。
下图是 fibjs(左)和 nodejs(右)的运行结果对比:
The text was updated successfully, but these errors were encountered: