Skip to content
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

Merged
merged 1 commit into from Nov 13, 2018

Conversation

gregberge
Copy link
Contributor

Q                       A
Fixed Issues? Fixes #8996
Patch: Bug Fix? 👍
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

See #8996 for context.

@babel-bot
Copy link
Collaborator

babel-bot commented Nov 8, 2018

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")) {
Copy link
Member

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.

@existentialism existentialism added PR: Bug Fix 🐛 A type of pull request used for our changelog categories pkg: types labels Nov 9, 2018
@gregberge
Copy link
Contributor Author

@loganfsmyth I made some changes according to your comments

@gregberge
Copy link
Contributor Author

All done, ready to merge!

@loganfsmyth loganfsmyth merged commit 4fcee17 into babel:master Nov 13, 2018
@loganfsmyth
Copy link
Member

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: types PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants