-
Notifications
You must be signed in to change notification settings - Fork 30k
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
EventEmitter.on exits function after async iteration of events #32360
Comments
Lines 697 to 700 in ffdf1de
|
same as ;(async () => {
await new Promise(() => {})
console.log('The End') // This is never printed...!
})() |
If you read the |
yes, sure. I just told what caused it. |
Ok guys, I understand now. My misunderstanding was based on the provided documentation that stated
I mistook this as if it meant that the loop exits, (so iterator is over), after all events registered up to that time are fired. Closing the issue as invalid. |
What steps will reproduce the bug?
I am not sure if this is actually an issue or it works as expected, but the newly introduced
EventEmiter.on
functionality used in afor await
, exits the function in which is called after iteration, without running the following commands. Notice the snippet from the actual documentation with an extra log line added:However this is not the case using a regular AsyncIterator:
So that is why I believe it is a problem with
EventEmitter.on
functionality...What is the expected behavior?
I believe it should continue execution of code after the loop
What do you see instead?
Code following loop is not run.
The text was updated successfully, but these errors were encountered: