-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Fixes stack overflow when exporting a lot in commonjs #38994
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
Conversation
If you fine folks want to introduce a |
statements, | ||
createExpressionStatement( | ||
reduceLeft( | ||
currentModuleInfo.exportedNames!.slice(i, i + chunkSize), |
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.
.slice()
substitutes the length of the array if the second argument is greater than .length
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.
The input file for the test is missing~
Sorry @weswigham, what do I need to provide besides |
|
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.
@rbuckton so long as you're OK with this, I think this is an OK fix for the issue, for now.
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.
@DanielRosenwasser we might want to ship this in the next 4.0 patch release. What do you think?
* Fixes stack overflow when exporting a lot in commonjs Fixes microsoft#38691 * Add missing test files
Fixes #38691
I went with the simple solution of not generating long chains of BinaryExpressions rather than introducing a new type similar to
CommaList
to avoid large and potentially buggy code churn.Please consider back porting to the next 3.9 release.
CC/ @weswigham @rbuckton @RyanCavanaugh