Skip to content

Conversation

@Lalitha-Iyer
Copy link
Contributor

Summary

This fix eliminates the possibility of a runtime error in environments without native support for Symbol.asyncIterator and async generators. In these environments it's likely Symbol.asyncIterator is not defined.

Babel regenerator that transforms the source to support async generators falls back to "@@asyncIterator" when Symbol.asyncIterator is not available.
https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L17

The fix is to use the existing "asyncIteratorSymbol" helper in Wonka to return the symbol for asynIterator, which accounts for filled-in support.

Set of changes

@Lalitha-Iyer Lalitha-Iyer changed the title use asyncIteratorSymbol helper accounts for "filled" support use asyncIteratorSymbol to get Symbol.asyncIterator Apr 18, 2025
@Lalitha-Iyer Lalitha-Iyer changed the title use asyncIteratorSymbol to get Symbol.asyncIterator use asyncIteratorSymbol helper to check for async Iterator support Apr 18, 2025
@Lalitha-Iyer Lalitha-Iyer changed the title use asyncIteratorSymbol helper to check for async Iterator support use asyncIteratorSymbol helper to check for async Iterator Apr 18, 2025
Copy link
Member

@kitten kitten left a comment

Choose a reason for hiding this comment

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

Nice catch! Very unintentional that this wasn't using the helper

@kitten kitten merged commit 0051a2f into 0no-co:main Apr 18, 2025
2 checks passed
@Lalitha-Iyer
Copy link
Contributor Author

Thanks for the quick review on this !

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