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

Make sure circular export * from X does not stack overflow #2836

Merged
merged 2 commits into from May 4, 2019

Conversation

Swatinem
Copy link
Contributor

@Swatinem Swatinem commented May 3, 2019

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

closes #2815

Description

Circular export * from X used to lead to a stack overflow. This Fix avoids that by keeping track of already walked modules. Not sure if this is the right place for such a fix?

@Swatinem Swatinem requested a review from lukastaegert May 3, 2019 15:47
@Swatinem Swatinem self-assigned this May 3, 2019
@lukastaegert
Copy link
Member

Looks great on first glance, unfortunately I have to quit working for today, hope to continue some time tomorrow

@Swatinem Swatinem force-pushed the circular-export-star branch 2 times, most recently from 6b9004e to 8b31835 Compare May 3, 2019 15:58
Copy link
Member

@lukastaegert lukastaegert left a comment

Choose a reason for hiding this comment

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

Very nice! I think there is a tiny bit room of improvement around where to place the bail-out condition, but in general really great work, including the test!

src/Module.ts Show resolved Hide resolved
src/Module.ts Outdated Show resolved Hide resolved
@lukastaegert lukastaegert merged commit 3596f1f into rollup:master May 4, 2019
@Swatinem Swatinem deleted the circular-export-star branch May 4, 2019 10:04
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.

circular export * from leads to infinite recursion
2 participants