-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Add missing visitNode call to object literal members #16767
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
This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. We will now review your pull request. |
I added a test case, but now I get the error
The proposed fix worked fine when I directly changed it in the typescript.js of a project. Can anyone help me out with this? :) |
Thanks for the PR Yogu! We have a callback in @rbuckton can you help look over this PR? |
@DanielRosenwasser Thanks. I wondered why we need to pass the static Now the build complains that the baseline file has changed. If I locally run the tests and then run |
That's very strange. Are you able to manually add baselines from |
My bad, now it worked. The build now passes :) |
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.
One minor comment. Also, can you resolve the conflict below? Thanks!
src/compiler/transformers/esnext.ts
Outdated
@@ -177,7 +177,7 @@ namespace ts { | |||
chunkObject.push(createPropertyAssignment(p.name, visitNode(p.initializer, visitor, isExpression))); | |||
} | |||
else { | |||
chunkObject.push(e as ShorthandPropertyAssignment); | |||
chunkObject.push(visitNode(e as ObjectLiteralElementLike, visitor, isObjectLiteralElementLike)); |
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.
You could remove the cast by changing the type of elements
to ObjectLiteralElementLike[]
.
Object literal elements that are neither spread elements, nor property assignments would not have visitNode called on them. Therefore, the esnext transformer would not be called on them and their children. Fixes microsoft#16765.
@rbuckton Thanks for the comments. I resolved the conflicts and applied your suggestion. Can you look over it again? |
Thanks for the contribution! |
@mhegazy should I port this to release-2.5 as well? |
yes please can you port it back. |
This is now in release-2.5. |
Object literal elements that are neither spread elements, nor property assignments would not have visitNode called on them. Therefore, the esnext transformer would not be called on them and their children.
Fixes #16765.