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
Fix cloneNode with typeAnnotation. #8997
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/9374/ |
@@ -66,6 +66,9 @@ export default function cloneNode<T: Object>(node: T, deep: boolean = true): T { | |||
...node.extra, | |||
}; | |||
} | |||
if (has(node, "typeAnnotation")) { |
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.
This should be up after line 39
, since I believe it would be the Identifier
optimization there that causes the problem. The field logic on 43
should already handle it for other types.
This will also need to recursively clone when deep
is set, like the logic on 45
does.
@loganfsmyth I made some changes according to your comments |
63bc497
to
cb8403c
Compare
cb8403c
to
09c89c7
Compare
All done, ready to merge! |
Thanks! |
Fixes #8996
See #8996 for context.