-
Notifications
You must be signed in to change notification settings - Fork 375
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
fix: top sort var/const globals #1854
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1854 +/- ##
==========================================
- Coverage 47.49% 45.03% -2.47%
==========================================
Files 388 464 +76
Lines 61305 68076 +6771
==========================================
+ Hits 29117 30655 +1538
- Misses 29750 34850 +5100
- Partials 2438 2571 +133 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the fix 🙏
Left some comments, mostly questions
Pinged @deelawn / @ajnavarro for a second look 🙏 |
per discussion with @jaekwon; see #1854 (comment)
This PR fixes this and this.
Before preprocessing, a dependency graph is created and edges between the nodes which represent the relationship between global
var
andconst
declarations.Then, a new slice of declarations is created that is topologically sorted.
This enables the rest of the preprocessing code to work the way it is now.
Small scale refactoring is included by removing unnecessary else statements in
PredefineFileSet
.