Fixes stack overflow when exporting a lot in commonjs - #38994
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.
.slice() substitutes the length of the array if the second argument is greater than .length
Wesley Wigham (weswigham)
left a comment
There was a problem hiding this comment.
The input file for the test is missing~
|
Sorry Wesley Wigham (@weswigham), what do I need to provide besides |
|
|
Wesley Wigham (weswigham)
left a comment
There was a problem hiding this comment.
Ron Buckton (@rbuckton) so long as you're OK with this, I think this is an OK fix for the issue, for now.
Nathan Shively-Sanders (sandersn)
left a comment
There was a problem hiding this comment.
Daniel Rosenwasser (@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
CommaListto avoid large and potentially buggy code churn.Please consider back porting to the next 3.9 release.
CC/ Wesley Wigham (@weswigham) Ron Buckton (@rbuckton) Ryan Cavanaugh (@RyanCavanaugh)