Skip to content

Fix type of computed name following spread #39319

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

weswigham
Copy link
Member

Fixes #39278

We weren't checking the right set of property names - because of how a spread works, after a spread, there's a complete disjoint between the properties symbol array and the properties on the expression node - we tried to capture that with with an offset variable so we could still use the nodes we already have to look up symbol names, but while that sometimes worked when a spread added props (depending on which past state we're talking about), it didn't handle cases where a spread added zero properties. In any case, to fix this, I stop trying to associate the expression property list with the symbol property list (which has been error prone), and lookup names from the symbols, and, additionally, mark what slice of the property symbol array we need to be looking at (before #39083, the offset variable was trying to specify a slice of the node array list, but that didn't handle spreads well when it was matched back up to the symbol list).

Context PRs: #12248 and more recently #39083

@weswigham weswigham merged commit ff1f449 into microsoft:master Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Index signature incorrectly includes undefined when computed property name and spread are both present
3 participants