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

Avoid infinite loops in export * from expansion #118

Merged
merged 8 commits into from
Feb 28, 2025

Conversation

Adjective-Object
Copy link
Owner

  • Avoids infinite loop while expanding unresolved external import
  • Avoids infinite loop while expanding cyclical imports
  • Adds maximum caps to all frontier traversals in graph generation and export * expansion

Max Huang-Hobbs and others added 8 commits February 20, 2025 19:59
In f66e808, I added a frontier walk to
expand recursive star imports would be resolved to a concrete set of
names.

However, this had a bug where if a star import into an external package
was visited, it would avoid expanding it, and infinitely loop after
seeing remaining "*" exports to expand.

This commit fixes that by ensuring that we only loop when the expanded
exports contain a '*', not when the file contains an unresolved '*'
export
Also updates the effectful import expansion logic to be recursive and
avoid exporting itself
@Adjective-Object Adjective-Object merged commit d5ed7e5 into main Feb 28, 2025
7 checks passed
@Adjective-Object Adjective-Object deleted the fix-recurse-expand branch February 28, 2025 19:39
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.

1 participant