-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: parameter variable infinite recursion error #5500
Conversation
Ensure before hasEffects of function body (triggered by function call), the arguments are first provided
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5500 +/- ##
==========================================
- Coverage 98.81% 98.81% -0.01%
==========================================
Files 238 238
Lines 9540 9538 -2
Branches 2436 2436
==========================================
- Hits 9427 9425 -2
Misses 48 48
Partials 65 65 ☔ 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.
Amazing, thanks for the quick fix. Yes, NewExpression and TaggedTemplateExpression should be the only other places where we call a variable. There is some additional call deoptimization logic in knownGlobals.ts, but I think that should be non-critical.
This PR has been released as part of rollup@4.17.1. You can test it via |
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
The function parameter will only get a known value when it is the callee of a function call. It is also where the
hasEffects
of function body gets called (and the only place?), we need to make sure the known value is set first, thenhasEffects
of function body gets called forNewExpression
andTaggedTemplateExpression
too. In that case, we can get exactly a "call tree" instead of a "call graph", so the known value of a parameter is guaranteed to come from somewhere outside the function and is guaranteed to from a "analyzed" code/function.