Skip to content
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

Opt out of loop protection if inside generator #4716

Merged
merged 2 commits into from
Apr 29, 2020

Conversation

BillyLevin
Copy link
Contributor

Fixes #4698

This PR will allow us to use loops within generator functions in the REPL without it throwing an incorrect "Infinite loop" error. This is done by opting out of loop_protect if the loop is inside a generator function

I have used generator_count rather than a simple boolean to make sure it works for nested generators also

I'm very new to both ASTs and the Svelte codebase so if there's a better way to do this I'd love to hear it!

Thanks

@Conduitry Conduitry merged commit 3d81131 into sveltejs:master Apr 29, 2020
@BillyLevin BillyLevin deleted the generator-infinite-loop-fix branch April 29, 2020 22:08
taylorzane pushed a commit to taylorzane/svelte that referenced this pull request Dec 17, 2020
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.

Infinite loop error in REPL when using generators
2 participants