-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Fix handling of aruments
in the emitter
#38880
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
Two problems are fixed: * `isArgumentsLocalBinding` did only `PropertyAccessExpression`, now it's also doing `PropertyAssignment` (doesn't affect other files, since it's only used in the emitter). * `visitShorthandPropertyAssignment` should call `visitIdentifier` on the synthesized id. (For completion it might be better to make it visit the the original?) Fixes microsoft#38594.
I ran into it and the comment at the top tripped me, then I proceeded to simplify the code. Patched a bit more of the function to make sure that the indentation doesn't change, and added tests.
switch (_c.label) { | ||
case 0: | ||
_b = { | ||
a: 1 |
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.
We still seem to have excess indentation. At this point it doesn't seem worth the extra time to keep digging into this. We can just remove the hasComputed
check and possibly come back to it later.
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.
Its up to you if you want to remove the hasComputed
check since there are too many corner cases it doesn't solve and at this point its not worth the extra time to dig into them.
Two problems are fixed:
isArgumentsLocalBinding
did onlyPropertyAccessExpression
, now it's also doingPropertyAssignment
(doesn't affect other files, since it's only used in the emitter).visitShorthandPropertyAssignment
should callvisitIdentifier
on the synthesized id. (For completion it might be better to make it visit the the original?)Fixes #38594.
Also, simplify
visitObjectLiteralExpression
(I ran into it and the comment at the top tripped me, then I proceeded to simplify the code. Patched a bit more of the function to make sure that the indentation doesn't change, and added tests.) This is in a separate commit since it's only loosely related.