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: assign trailing comment to ObjectProperty only when inside an ObjectExpression #10292

Merged
merged 1 commit into from Aug 13, 2019

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Aug 1, 2019

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

This is a follow up to babel/babylon#478.

When assigning tailing comment to an ObjectProperty, we should ensure the comment is inside the ObjectExpression, otherwise we would incorrectly assign a trailing comment of ObjectExpression, meanwhile the leading comment of subsequence statements, to this ObjectProperty.

@JLHwung JLHwung force-pushed the fix-10230 branch 2 times, most recently from 81f4ab4 to d58b88e Compare August 1, 2019 19:21
@JLHwung JLHwung added area: comments pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories labels Aug 1, 2019
@babel-bot
Copy link
Collaborator

babel-bot commented Aug 1, 2019

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11280/

@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11279/

@existentialism existentialism merged commit 75090f1 into babel:master Aug 13, 2019
@JLHwung JLHwung deleted the fix-10230 branch August 13, 2019 19:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: comments outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser 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.

Comments unexpectedly showing up in trailingComments as opposed to leadingComments in some cases.
4 participants