Conversation
mhegazy
approved these changes
May 12, 2017
Contributor
mhegazy
left a comment
There was a problem hiding this comment.
Can you add a test for the stack over flow to make sure we do not regress this.
ajafff
reviewed
May 12, 2017
| return node; | ||
| } | ||
|
|
||
| export function createCommaList(elements: Expression[]) { |
Contributor
There was a problem hiding this comment.
rename to createCommaListExpression to align with the other create or update functions?
Contributor
Author
There was a problem hiding this comment.
Actually, most other create/update functions for expressions elide the word Expression.
| return node; | ||
| } | ||
|
|
||
| export function updateCommaList(node: CommaListExpression, elements: Expression[]) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When transforming a ObjectLiteralExpression with a large number of computed property names, we currently create a very large tree of binary expressions that is deeply nested along the right hand side. In some extreme cases, when we attempt to print the tree we end up exhausting all of the available stack space.
This change introduces a synthetic
CommaListnode which flattens a large number of comma expressions into a single list to reduce the overall tree depth.Fixes #13935