Skip to content

Comments

Fix freezing when calling iterator.return()#1

Merged
sindresorhus merged 6 commits intosindresorhus:mainfrom
Richienb:fix-frozen-return
Sep 7, 2025
Merged

Fix freezing when calling iterator.return()#1
sindresorhus merged 6 commits intosindresorhus:mainfrom
Richienb:fix-frozen-return

Conversation

@Richienb
Copy link
Contributor

@Richienb Richienb commented Sep 6, 2025

Issue seems to be related to while (true) locking up the event loop.

We also don't bother clearing the body in the tests, since the tests aren't synchronous, so it doesn't really help.

Related to sindresorhus/element-ready#59

@Richienb Richienb changed the title Fix freezing when calling .return() Fix freezing when calling iterator.return() Sep 6, 2025
}
});

test('skips mutations before next()', async t => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want this behaviour?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@sindresorhus sindresorhus merged commit be37f73 into sindresorhus:main Sep 7, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants