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
Merged

Conversation

@gregberge
Copy link
Contributor

@gregberge gregberge commented Nov 8, 2018

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 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")) {

This comment has been minimized.

@loganfsmyth

loganfsmyth Nov 9, 2018
Member

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.

@gregberge
Copy link
Contributor Author

@gregberge gregberge commented Nov 9, 2018

@loganfsmyth I made some changes according to your comments

@gregberge gregberge force-pushed the gregberge:fix-clone-node branch from 63bc497 to cb8403c Nov 9, 2018
@gregberge gregberge force-pushed the gregberge:fix-clone-node branch from cb8403c to 09c89c7 Nov 9, 2018
@gregberge
Copy link
Contributor Author

@gregberge gregberge commented Nov 10, 2018

All done, ready to merge!

@loganfsmyth loganfsmyth merged commit 4fcee17 into babel:master Nov 13, 2018
4 checks passed
4 checks passed
@babel-bot
babel/repl REPL preview is available
Details
ci/circleci Your tests passed on CircleCI!
Details
@codecov
codecov/project 80.68% (target 80%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@loganfsmyth
Copy link
Member

@loganfsmyth loganfsmyth commented Nov 13, 2018

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants